Re: PHP help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



<snip>

PHP file called "addform.php":

<?

$user="chris";
$database="test";
mysql_connect(localhost,$user);
@mysql_select_db($database) or die("unable to select
database");
$query="INSERT INTO login VALUES ("'$login')";
mysql_query($query);
mysql_close();
?>
</snip>

Okay the line $query is wrong.  So I quote...

<QUOTE>

$query="INSERT INTO login VALUES ("'$login')";

</QUOTE>

You have ("'$login')"; ... Why the " before the
'$login?

It should be:

$query="INSERT INTO login VALUES ('$login')";

Goodluck!


http://mobile.yahoo.com.au - Yahoo! Mobile
- Check & compose your email via SMS on your Telstra or Vodafone mobile.

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux