Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

~15.5K People Reached
About Me

Computer Nerd :)

PC Specs
Windows 7
Favorite Tags
php x 46
c x 1
Member Avatar for ElegantElephant
Member Avatar for Bharane_1
0
232
Member Avatar for ElegantElephant

For example, I have a string containing "184553", how do I go about extracting the 3rd character "4" from string string and assigning it to another variable? I have tried the following code but it does not work, the system crashes: [CODE] char string[6] = "184553"; printf("%s",string[2]); // Expecting it …

Member Avatar for Ancient Dragon
0
8K
Member Avatar for niths

--You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Resource id #10' at line 1--- [code] <html> <body> <form action="login.php" method="post"> <div> <table width="100%"> <tr> <td><img src="Logofinalcopy.gif"></td> </tr> <tr> <td bgcolor="aqua"><h2>Login</h2></td> </tr></table> <table align="right" …

Member Avatar for richieking
-1
340
Member Avatar for ElegantElephant

Is it possible to obtain the next insert ID without actually executing a proper insert query? I am writing a file upload script but the name of the folder the file gets uploaded to depends on the next insert ID of a certain table. Would appreciate any help with this.

Member Avatar for loganphp
0
4K
Member Avatar for ElegantElephant

I don't know if it's obvious but I'm not entirely sure how to delete joined table records? For example. I have a project which also has associated contracts, files etc in other tables. They are all linked using the project foreign key. How do I construct a query to that …

Member Avatar for sandimcp
0
116
Member Avatar for ElegantElephant

Is it possible to use PHP and a mysql query combined to allow a whole database backup file to be downloaded? For example, I'm currently backup up my database by using the export tool in phpmyadmin, but what if I wanted to add a button or link on my site …

Member Avatar for diafol
0
171
Member Avatar for leto-hostes.com

[code=php]<?php $con = mysql_connect('localhost', 'leto_hostes', 'password_hidden'); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("letohost_player", $con); $sql="INSERT INTO `letohost_user`.`player` (`USER_ID` ,`USERNAME` ,`PASSWORD` ,`EMAIL` ,`POSITION` ,`ACTIVE` ,`MEMBER` ) VALUES (NULL , '$_POST[register_username]', 'md5($_POST[register_password])', '$_POST[register_email]', '0', '0', '0');)"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } echo "1 record added"; …

Member Avatar for diafol
0
183
Member Avatar for mvblhp

(I want to make free subscription area where members' info is deleted from mysql when 30 days old) I already have have a members login script.... but i have to manually delete users.....what i really need is to know how to make member expire after so many days with a …

Member Avatar for almostbob
0
171
Member Avatar for ElegantElephant

I am having trouble with a certain query. The problem is that I am using an INNER JOIN with two tables that both have a column called "id". I want the query to return ALL the column names but in addition I also want table1.id to be returned as id1 …

Member Avatar for jmo
0
134
Member Avatar for ElegantElephant

Any way to change the formatting of the text and what is displayed after a die() command? I'm currently coding all my errors using die() but I'd like to have more control over how the error message is formatted and what is displayed afterwards (like a return link for example)

Member Avatar for Jerail
0
115
Member Avatar for ElegantElephant

How do I code a function that uses external variables? For example? I have an upload script that I am using repeatedly through a few pages. I'd like to make my code more efficient and just define the upload script as a function and call it every time I need …

Member Avatar for ElegantElephant
0
130
Member Avatar for ElegantElephant

I have this code to validate part of a file upload: [CODE]if (!($fileExt == 'doc' || $fileExt == 'docx' || $fileExt == 'pdf')) { $error = 'The file does not meet the file type requirments. Only Microsoft Document and PDF files are allowed.'; $etype = '1'; include ('inc/error.php'); }[/CODE] Is …

Member Avatar for ElegantElephant
0
95
Member Avatar for ElegantElephant

[CODE]$query = "INSERT INTO update_feedback (updateID,comment,timestamp) VALUES ('$updateID','$comment',NOW())"; $result = mysqli_query($dbcon,$result) or die('Error saving feedback into database. ' .mysqli_error($dbcon));[/CODE] Gives me this error: [QUOTE]Error saving feedback into database. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax …

Member Avatar for ElegantElephant
0
91
Member Avatar for guruwannabe

pls i really need someone who can put me through php.i am really intrested in the language and just in need of someone to help me...

Member Avatar for Kruptein
0
131
Member Avatar for virtualmisc

Hi friends I have a site made in PHP Can someone please help with Email address validation? Thanks

Member Avatar for muralibobby2015
0
184
Member Avatar for ElegantElephant

Just wondering if it normal and acceptable use both on one string before entering it into a database or displaying it? For example: [CODE]$project_name = mysqli_real_escape_string($dbcon,htmlspecialchars($_POST['project_name']));[/CODE]

Member Avatar for ElegantElephant
0
80
Member Avatar for ElegantElephant

I have a dropdown list and the selected item depends on the record the form is for. How do I allow PHP to determine which item in the list is selected according to how that row is configured?

Member Avatar for saiprem
0
80
Member Avatar for ElegantElephant

I have a date in the form DD-MM-YYYY, I know how to explode it into just DD, MM and YYYY on its own but how do I check if this date is valid? For example 01-02-2009 is valid but 31-02-2009 is not. Any way to check this?

Member Avatar for diafol
0
111
Member Avatar for ElegantElephant

I have a small problem with a MYSQL select query involving an INNER JOIN. Both tables that I'm joining have a field that have identical names. So when I use[CODE] $array = mysqli_fetch_array($result,1); $field = array['fieldname'];[/CODE] it returns the wrong value from the wrong table. Is there any way around …

Member Avatar for JRM
0
95
Member Avatar for ElegantElephant

I have a select menu with many text-based options. However when I submit the form, instead of actually returning the textual item in the POST variable is it possible to set it to return the ID of the selected item? For example I have the following form: [CODE]<select name="dev_stage" id="dev_stage"> …

Member Avatar for ElegantElephant
0
94
Member Avatar for ElegantElephant

I have a date in the format of YYYY-MM-DD as a string (including the hyphens) How do I split this string just to obtain YYYY, MM and DD separately? Possible use of an array or something? Would really appreciate some help :) Edit: Nevermind, just discovered the explode() function :P

Member Avatar for csmgsarma
0
102
Member Avatar for ElegantElephant

I have the following file called config.php. These are configuration options for a client management system. I need these settings to be editable via the system admin panel. How would I go about storing these values in a database? Would it make sense to have a table called "config" with …

Member Avatar for ElegantElephant
0
102
Member Avatar for ElegantElephant

I have a table called projects, and I'm currently coding the "create a project" functionality that allows the administrator to create a new project and save it in the projects mysql table. I have a slight problem though, I have two fields/inputs named start date and deadline date, what should …

Member Avatar for saiprem
0
84
Member Avatar for ElegantElephant

I have a section in my PHP page containing this bit of code: [CODE] echo '<div style="float:left;"><h3><strong>Edit User Account</strong></h3> Date Registered: ' . $db_regdate . '<br> User Type: ' . $usertype . '<br><br> <form class="right_aligned" id="form1" name="form1" method="post" action=""> <label>First Name*</label> <input name="firstname" type="text" id="firstname" value="' . $db_firstname . '"/> …

Member Avatar for ElegantElephant
0
107
Member Avatar for ElegantElephant

I am currently working on a client management system for my Computing Coursework and I've come to the "Client Details" section, which allows staff and admin to view personal information about each client. I've successfully coded the query and everything else around it, I'm just a but stuck on how …

Member Avatar for ElegantElephant
0
85
Member Avatar for ElegantElephant

I am currently working on a client management system for a college project. I am planning to include a feature to allow users to upload files for a specific project. All files will be specific to one project and clients can only view files for a project that they are …

Member Avatar for rajeesh_rsn
0
74