Jump to content

php problem with search records


tomks77

Recommended Posts

Hi there i am new in php and new in this forum..i sow a tutorial of php and started to learn but i started tohave some problems that i couldn't find an answer for.. i have a database and a table called costumers, i have a form with some textboxes where user put name, city, fone, e-mail, and click on save button, thats ok. and i used an other button to show allthe records in the table. and thats ok too, the PROBLEM is when i want to show a record from the table using the field ID. and toshow this record in the same textboxes.. i used : SQL ="SELECT id FROM costumers WHERE id=&_POST['id']"; untill here i can say like this: if ($result){print "record found";} but i am not able to make the information to appeare in the textboxes..look at the code: $findname=$_POST['id']; //text box with the name id in the form. $sqlfind="SELECT id FROM costumers WHERE id='$findname'";$sqlfind2=mysql_query($sqlfind); while ( $db_field= mysql_fetch_array($sqlfind2)){ $name1=$db_field['name']; } }else {print "<BR>". "This ID does not exist";} i keep having the error: Notice: Undefined index: name in ****** line number .. which is the 'name' in this line:$name1=$db_field['name']; so why it can not see the textbox named 'name'?? okey... i tried to show the record informations in a secund page. that hase a textbox called 'id' to show the ID field in the table costumers , but afterclicking in submit and go to the secund page it gives me this error:Notice: Undefined index: id in*** so as you see its like the textbox id is not there... if eny one have a good advise or some thing....all be happy, thanks

Edited by tomks77
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...