Note that the multiple lines are just a visual formatting thing - the query would execute the same if you had it all on the same line. However, it is often convenient to break it up to make the source code easier to read. I usually do that by using the "heredoc" method of defining a string:
PHP Code:
$query = <<<EOD
INSERT INTO test
VALUES ('Name', 'Age', 'Birthday')
EOD;
$result = mysql_query($query) or die(mysql_error());
$rows = mysql_affected_rows();
echo "<p>$rows row(s) inserted into database</p>\n";
Bookmarks