Re: No data being put into the DB
| From: | Jason Wong | Date: | Thu, 04 Mar 2004 01:33:14 +0000 |
| Subject: | Re: No data being put into the DB | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-33278@lists.php.net to get a copy of this message | ||
On Thursday 04 March 2004 08:08, Rich Hutchins wrote:
> Oh, and, normally, you reference the variables like so: $_POST["varname"].
> I typically use the following syntax:
>
> "INSERT INTO tablename
>
> VALUES('".$_POST["varone"]."','".$_POST["vartwo"]."');
IMO it is better to use the braces syntax:
"insert into show
values('','{$_POST['Accnt_name']}','{$_POST['acc_num']}',
...)"
> In your query you have omitted the quotes. Don't know if that causes
> problems, but echoing out $addtocart would show that anyway.
Also ...
> mysql_close();
> $error = mysql_error();
call mysql_error() before you close the connection.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
------------------------------------------
/*
If you give Congress a chance to vote on both sides of an issue, it
will always do it.
-- Les Aspin, D., Wisconsin
*/