RE: Question: Putting separate form elements into an array

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

 



Stuart, what does your echo($query) line output?

I would hazard a guess that your quotes are wrong and you are not getting
what you expect.

What is &LUID?

I believe you will need to execute an INSERT query within each "for($i=0;
$i<count($l_skill); $i++)" loop or increment & add $LUID within each
iteration, if this is the unique record ID for each record to be inserted.

Graham

[snip]
>
> This is how I am trying to get them into the database:
>
> $queries = array();
> for($i=0; $i<count($l_skill); $i++)
> {
>     $queries[] = "('" . $l_skill[$i] . "', " .
> $l_sky[$i] . ", " . $l_slu[$i] . ")";
> }
>
> if(count($queries) == 0)
> {
>     # Nothing passed
>     # exit
> }
>
> $query = "INSERT INTO LurkProfiles_Skicerts
> (ProfileID, SkilCerts, NumYear, Lused)
> VALUES ($LUID ". implode(", ", $queries);
>
> //Above line is where I am having the problem.  There
> is something between LUID and the implode statement.
> LUID is not passing into the insert generating a sql
> error.
>
>
> $result = mysql_query($query);
> echo $query;
>

-- 
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