Click to See Complete Forum and Search --> : [RESOLVED] Beginner with PHP, Need help with PhP file


pmato23
08-19-2006, 12:02 PM
Hi, If anyone can help me with this code, please reply. I have 1 problems, the script does not assign values to $first and $last from the user's input.

$query = 'SELECT * FROM `Santa List` WHERE `first_name` = CONVERT(_utf8 \'gianna\' USING latin1) COLLATE latin1_swedish_ci AND `last_name` = CONVERT(_utf8 \'macagno\' USING latin1) COLLATE latin1_swedish_ci';

use

$first = $_POST['firstname'];
$last = $_POST['lastname'];

$result = mysql_query("SELECT * FROM `Santa List` WHERE first_name = '$first' AND `last_name` = '$last'");
$r=mysql_fetch_array($result);

aussie girl
08-19-2006, 09:04 PM
I would get rid of the prompt boxes and use the form inputs, then you can use them in your query

$first = $_POST['firstname']
$last = $_POST['lastname']

pcthug
08-20-2006, 04:38 AM
Please Read (http://www.webdeveloper.com/forum/showthread.php?p=546768#post546768)