Rifts Posted November 12, 2010 Share Posted November 12, 2010 can I do this mysql_query("INSERT INTO directory (field, field, field, field,field,field, field,field,field, fieldfield,field, field,field,field,) VALUES ('field','field','field', 'field','field','field', 'field','field','field', 'field','field','field' ,'field','field','field',)"); please ignore any syntax errors and stuff its just the concept of breaking it into different lines? thanks Link to comment https://forums.phpfreaks.com/topic/218530-can-you-break-up-really-long-mysql-queries/ Share on other sites More sharing options...
BlueSkyIS Posted November 12, 2010 Share Posted November 12, 2010 yes. Link to comment https://forums.phpfreaks.com/topic/218530-can-you-break-up-really-long-mysql-queries/#findComment-1133648 Share on other sites More sharing options...
Pikachu2000 Posted November 12, 2010 Share Posted November 12, 2010 Yes. And you're really better off to store the query string in a variable, then use the variable when you execute the query. It makes debugging much easier. $query = "SELECT `field` FROM `table`"; $result = mysql_query( $query ); Link to comment https://forums.phpfreaks.com/topic/218530-can-you-break-up-really-long-mysql-queries/#findComment-1133650 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.