Hi,
I'm trying to get a little bit of code working to basically insert data into my database using a loop. For some reason it isn't working, but it doesn't give me an error message, all I can get it to tell me is whether it updated the row or not:
Code:
foreach( $infoArray['infostream']['class_description'] as $k )
{
mysql_query( [INSERT INTO blah ( id, name, class_id) VALUES ('', '".$k['name']."', '".$new_class_id."')] );
echo mysql_affected_rows()." atttributes inserted.\n";
}
Which gives me an output of:
-1 atttributes inserted.
-1 atttributes inserted.
-1 atttributes inserted.
-1 atttributes inserted.
Is there anyway to get more information about what's going on? I replaced mysql_query with echo and my queries appear to be correct, but there's absolutely no error messages!
Can anyone lend some friendly advice?
Thanks,
James