For 40 variables I would recomend keeping them in a single array and then loop the array:

$vars['part2']='something else';

foreach($vars as k => $v) {

John Taylor-Johnston wrote:

Yes I'm reading the FM :)

I should know this. How will I PHP this SQL into my MySQL table?

INSERT INTO testals VALUES ($part1, $part2, $part3, $part4);

I'm particularily concerned aboute single quotes. How do I escape them? Should I?

Here is what I think is right.

$myconnection = mysql_connect($server,$user,$pass);

$query = "INSERT INTO testals VALUES (addslashes($part1), addslashes($part2), addslashes($part3), addslashes($part4));";



That's it, right? I have about 40 variables. I wanted to run the code through here before I start.


PHP General Mailing List (
To unsubscribe, visit:

Reply via email to