Re: Newbie MySQL problem
| From: | Jason Cox | Date: | Tue, 26 Sep 2000 06:51:42 +0000 |
| Subject: | Re: Newbie MySQL problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-17539@lists.php.net to get a copy of this message | ||
Adam,
When you insert your values, are you sure you are giving a value for every
column. With the exception of columns with default values, I've found that
mysql through PHP often won't complain, it just won't insert anything. You
might check that.
Jason Cox
http://hosting.webpipe.net
----- Original Message -----
From: "Adam Charnock" <adamcharnock@btinternet.com>
To: "PHP Mailing List" <php-general@lists.php.net>
Sent: Tuesday, September 26, 2000 12:13 AM
Subject: [PHP] Newbie MySQL problem
> Hi all, im just learning MySQL and im trying to loop through a 2d array
and
> add its values to a table. I don't get any errors but nothing gets added
to
> the table. I have opened all the connections etc. so I am not sure what
the
> problem is:
>
> for($a=0;$a<count($categories);$a++){
>
> $sqlquery = "INSERT INTO $cattable
>
VALUES('$id','$categories[$a][0]','$categories[$a][1]','$categories[$a][2]',
> '$categories[$a][3]','0')";
> $results = mysql_query($sqlquery);
> echo
>
$categories[$a][0],$categories[$a][1],$categories[$a][2],$categories[$a][3],
> "<br><br>\n\n\n";
>
> }
>
> Thanks :-)
>
> Adam Charnock
>
> PS. This is actually part of a news grabber from moreover.com, I have made
a
> non-MySQL version but it just needs speeding up. If anyone has done this I
> would love to speak to them :) thanks!
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>
_______________________________________________________
Site Design, Hosting, and E-Commerce at www.webpipe.net