MouseMuffin Posted January 18, 2010 Share Posted January 18, 2010 And echo them so I can debug and see what im running? Link to comment https://forums.phpfreaks.com/topic/188858-how-do-i-show-all-the-queries-im-running/ Share on other sites More sharing options...
MatthewJ Posted January 18, 2010 Share Posted January 18, 2010 $query = "SELECT * FROM ...."; .... echo $query; Link to comment https://forums.phpfreaks.com/topic/188858-how-do-i-show-all-the-queries-im-running/#findComment-997087 Share on other sites More sharing options...
MouseMuffin Posted January 18, 2010 Author Share Posted January 18, 2010 NO i mean like a Debugging script Link to comment https://forums.phpfreaks.com/topic/188858-how-do-i-show-all-the-queries-im-running/#findComment-997088 Share on other sites More sharing options...
oni-kun Posted January 18, 2010 Share Posted January 18, 2010 And echo them so I can debug and see what im running? Echo $sql? Or you can write them to disk even (appending to a log) $sql = "SELECT * WHERE TABLE = .."; mysql_query($sql); $fp = fopen("sql_log.html", "a"); fputs($fp, "<b>Time:</b> " . date("F jS Y, h:iA") . "<br/>\n"); fputs($fp, "$sql <br/>\n"); fclose($fp); Or use a query to get mysql_affected_rows NO i mean like a Debugging script What on earth do you mean? You won't get help like this. Debugging is impossible unless you use exec such as running the linux command --slow_query_log_file=file_name[...], makes no sense unless you give us an example of what you want to do. Link to comment https://forums.phpfreaks.com/topic/188858-how-do-i-show-all-the-queries-im-running/#findComment-997090 Share on other sites More sharing options...
MouseMuffin Posted January 18, 2010 Author Share Posted January 18, 2010 YOu know what I want to do? make wash your mouth out with soap u non helping bastard!!!!!!!!!!!!!!!!!!!!!!!!!!!! All I asked was to show all the queries that are run at the bottom of my page so I can figure out what I am doing, I guess your not too bright arn't ya fella. Link to comment https://forums.phpfreaks.com/topic/188858-how-do-i-show-all-the-queries-im-running/#findComment-997097 Share on other sites More sharing options...
oni-kun Posted January 18, 2010 Share Posted January 18, 2010 YOu know what I want to do? make wash your mouth out with soap u non helping bastard!!!!!!!!!!!!!!!!!!!!!!!!!!!! If you were intelligent enough to base ideas off the advice given, and press a link that I provided (assuming you are), than you would have found your answer. If you have problematic code, show us, and ask for a solution, that is all you'll get, not the magic answer you expected. All I asked was to show all the queries that are run at the bottom of my page If you would have actually asked that, you would have gotten a better idea of what to do, funny how it works eh? Link to comment https://forums.phpfreaks.com/topic/188858-how-do-i-show-all-the-queries-im-running/#findComment-997100 Share on other sites More sharing options...
MouseMuffin Posted January 18, 2010 Author Share Posted January 18, 2010 Dont even reply here kid, you know nothing. Neither do your thorpe i dont wnana see you here Link to comment https://forums.phpfreaks.com/topic/188858-how-do-i-show-all-the-queries-im-running/#findComment-997102 Share on other sites More sharing options...
trq Posted January 18, 2010 Share Posted January 18, 2010 There is no debugger built into php itself. oni-kun has posted what would be considered a (simple yet) valid solution. You need to save your queries into a variable, then either write them to a file or echo them to the screen. An easier method would be to make a function that you can use to actually log, and at the same time return your queries. Something like.... function query($sql) { file_put_contents(date() . ' : ' $sql, '/path/to/logfile/sql.log', FILE_APPEND); return $sql; } You could then use this within your queries like so.... mysql_query(query("SELECT * FROM foo")); Ps: Please don't so uptight with our members, everyone is here to help. Link to comment https://forums.phpfreaks.com/topic/188858-how-do-i-show-all-the-queries-im-running/#findComment-997106 Share on other sites More sharing options...
trq Posted January 18, 2010 Share Posted January 18, 2010 Neither do your thorpe i dont wnana see you here And what exactly was that comment for? Link to comment https://forums.phpfreaks.com/topic/188858-how-do-i-show-all-the-queries-im-running/#findComment-997107 Share on other sites More sharing options...
oni-kun Posted January 18, 2010 Share Posted January 18, 2010 Neither do your thorpe i dont wnana see you here And what exactly was that comment for? He feared your coloured name and edited his post? Personally that made me laugh. Link to comment https://forums.phpfreaks.com/topic/188858-how-do-i-show-all-the-queries-im-running/#findComment-997110 Share on other sites More sharing options...
trq Posted January 18, 2010 Share Posted January 18, 2010 He feared your coloured name and edited his post? Personally that made me laugh. While I was spending my own time helping even. What a nerve. Link to comment https://forums.phpfreaks.com/topic/188858-how-do-i-show-all-the-queries-im-running/#findComment-997112 Share on other sites More sharing options...
MouseMuffin Posted January 18, 2010 Author Share Posted January 18, 2010 There is no debugger built into php itself. oni-kun has posted what would be considered a (simple yet) valid solution. You need to save your queries into a variable, then either write them to a file or echo them to the screen. An easier method would be to make a function that you can use to actually log, and at the same time return your queries. Something like.... function query($sql) { file_put_contents(date() . ' : ' $sql, '/path/to/logfile/sql.log', FILE_APPEND); return $sql; } You could then use this within your queries like so.... mysql_query(query("SELECT * FROM foo")); Ps: Please don't so uptight with our members, everyone is here to help. Lol how retarded can u get? This method will not work, This will just save each query And then when I try to read there going to be all bunched in there, I only need to show each querie once not store them, Lol how retarded can you guys geT? Go learn some C+ Link to comment https://forums.phpfreaks.com/topic/188858-how-do-i-show-all-the-queries-im-running/#findComment-997113 Share on other sites More sharing options...
oni-kun Posted January 18, 2010 Share Posted January 18, 2010 Go learn some C+ Are you posting your grade? Link to comment https://forums.phpfreaks.com/topic/188858-how-do-i-show-all-the-queries-im-running/#findComment-997114 Share on other sites More sharing options...
Buddski Posted January 18, 2010 Share Posted January 18, 2010 If you don't like the answers given and want to insult people go somewhere else.. We didnt ask you to come here.. If your so smart develop your own solution... Link to comment https://forums.phpfreaks.com/topic/188858-how-do-i-show-all-the-queries-im-running/#findComment-997115 Share on other sites More sharing options...
trq Posted January 18, 2010 Share Posted January 18, 2010 I suggest you find another board to post your insults, your life here will be short lived with an attitude like that. Link to comment https://forums.phpfreaks.com/topic/188858-how-do-i-show-all-the-queries-im-running/#findComment-997116 Share on other sites More sharing options...
Recommended Posts