Re: PHP help

From: Date: Mon, 30 Jun 2003 10:24:48 +0000
Subject: Re: PHP help
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-28968@lists.php.net to get a copy of this message
<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.

« previous php.db (#28968) next »