PHP/mySQL question
Posted: Sat Nov 23, 2002 12:17 pm
What I'm trying to do:
When you enter information into a form and send it, the I want the "action" script to input the form content into a mySQL database, using variables
Here's the script:
// Create the user
//-----------
echo("Attempting to create the user data[br]");
//-----------
$crtuser = 'INSERT INTO `binupoll_user` (`name`, `pass`) VALUES ($uname, $upass);';
$crtusrmysql = mysql_db_query($db, $crtuser);
if( $crtusrmysql == true )
{
echo("[img src='images/green.gif'] Created user info[br]");
}
else
{
echo("[img src='images/red.gif'] Failed to create user info[br]");
}
//-------
The $uname and $upass variables contain the information from the form input areas uname and upass. When I run the script, instead of it inputting the information in the variables, it inputs the test $uname and $upass into the database.
Thanks for any help,
When you enter information into a form and send it, the I want the "action" script to input the form content into a mySQL database, using variables
Here's the script:
// Create the user
//-----------
echo("Attempting to create the user data[br]");
//-----------
$crtuser = 'INSERT INTO `binupoll_user` (`name`, `pass`) VALUES ($uname, $upass);';
$crtusrmysql = mysql_db_query($db, $crtuser);
if( $crtusrmysql == true )
{
echo("[img src='images/green.gif'] Created user info[br]");
}
else
{
echo("[img src='images/red.gif'] Failed to create user info[br]");
}
//-------
The $uname and $upass variables contain the information from the form input areas uname and upass. When I run the script, instead of it inputting the information in the variables, it inputs the test $uname and $upass into the database.
Thanks for any help,