|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
making a query based on the value of a textbox
i have a form and it uses the post method and i need to search for a username in a table...and the value of the textbox is the username..this code wont work..im having some troub, im fairly new to php can someone help me out...
<?php echo "x_1 = " . $_POST['x_1']; $db = mysql_connect("localhost", "root"); mysql_select_db("users",$db); $result = mysql_query("SELECT * FROM info WHERE username = '$_POST['$x_1']' ",$db); printf("ID: %s<br>\n", mysql_result($result,0,"id")); printf("Username: %s<br>\n", mysql_result($result,0,"username")); printf("Password: %s<br>\n", mysql_result($result,0,"password")); ?> |
|
#2
|
||||
|
||||
|
Try:
PHP Code:
__________________
Please don't PM me asking for solutions outside the scope of a thread. Keeping all responses in a thread stands to help others who come along later, which is after all what this forum's all about. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > Programming Tools > making a query based on the value of a textbox |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|