HoTDaWg Posted March 31, 2007 Share Posted March 31, 2007 just to double check you can simply do: <?php mysql_query($sql,$connection); //rather than $results = mysql_query($sql,$connection); ?> at the same time, a user on the php manual wrote this under comments regarding mysql_query: It says in the manual: The query string should not end with a semicolon. However, I read somewhere that it is good practice to add a semicolon at the end of your query, and that it increases security against SQL-injection attacks. Therefore I have issued a requirement that all my developers end queries with semicolons. So far, PHP & MySQL have happily accepted those queries, with only one exception: If you use more then one query in the same call to mysql_query, MySQL sometimes only executes the first query and fails on the others. so, should i end my mysql_queries with a ; or should i not ??? is there some sort of alternate method. thanks for any help possible, .-=!HoTDaWg!=-. Link to comment https://forums.phpfreaks.com/topic/45038-mysql-query-2-questions/ Share on other sites More sharing options...
HoTDaWg Posted March 31, 2007 Author Share Posted March 31, 2007 any ideas? Link to comment https://forums.phpfreaks.com/topic/45038-mysql-query-2-questions/#findComment-218732 Share on other sites More sharing options...
genericnumber1 Posted March 31, 2007 Share Posted March 31, 2007 by not using ; I think he means inside the query... use SELECT * FROM table not SELECT * FROM table; as for your first question... yes you can technically do mysql_query($sql,$connection); but you're not assigning the resource to any variables so you can't use it... Link to comment https://forums.phpfreaks.com/topic/45038-mysql-query-2-questions/#findComment-218737 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.