Andy B <mailto:[EMAIL PROTECTED]> on Tuesday, April 06, 2004 7:56 PM said:
> $query="insert into table values( > '{$array['index1']['index2']}', > '{$array[index2']['index3']}', > //so on down the list > )"; > > if i understand the readable way right... no, not quite. here is how you should do it (imo): 1. always write SQL commands in upper case. i.e. "SELECT name FROM table" 2. indent the different sections of the query. i'm not sure that i'm indenting correctly, but i'm basically just copying SQL statements i've seen in the past, as far as indentation goes. $query = " INSERT INTO table VALUES ( '{$array['index1']['index2']}' , '{$array['index2']['index3']}' )"; > oh btw if you do something like that is it possible to insert > comments in the middle of a query like that without breaking it up > (i.e. for huge queries comment on what the variables are for)?? yes. i don't know if mysql supports them but i think it works like this: $query = " INSERT INTO table /* comment */ VALUES ( '{$array['index1']['index2']}' , '{$array['index2']['index3']}' )"; hth, chris. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php