DiscoTrio Posted November 1, 2009 Share Posted November 1, 2009 Well I know this is easy but I am trying to make a file where it is the simplest possible way to execute a mysql query. I need to fill in the php script with this: Database name, username, pass. And the sql query which I have. Here is the query: ALTER TABLE `snews` ORDER BY `id2` DESC Link to comment https://forums.phpfreaks.com/topic/179886-solved-need-to-execute-mysql-query-with-php/ Share on other sites More sharing options...
DiscoTrio Posted November 2, 2009 Author Share Posted November 2, 2009 errrrrrrrrr, hello.............? Link to comment https://forums.phpfreaks.com/topic/179886-solved-need-to-execute-mysql-query-with-php/#findComment-948962 Share on other sites More sharing options...
DiscoTrio Posted November 2, 2009 Author Share Posted November 2, 2009 Dont be shy I just need a start..... Link to comment https://forums.phpfreaks.com/topic/179886-solved-need-to-execute-mysql-query-with-php/#findComment-948980 Share on other sites More sharing options...
Mundo Posted November 2, 2009 Share Posted November 2, 2009 <?php mysql_connect("localhost", "username", "password") or die(mysql_error()); mysql_select_db("databasename") or die(mysql_error()); $query = mysql_query("ALTER TABLE `snews` ORDER BY `id2` DESC"); ?> It might also be useful for you to read the following: http://www.tizag.com/mysqlTutorial/index.php Link to comment https://forums.phpfreaks.com/topic/179886-solved-need-to-execute-mysql-query-with-php/#findComment-948986 Share on other sites More sharing options...
DiscoTrio Posted November 2, 2009 Author Share Posted November 2, 2009 thanx! Link to comment https://forums.phpfreaks.com/topic/179886-solved-need-to-execute-mysql-query-with-php/#findComment-948987 Share on other sites More sharing options...
Mundo Posted November 2, 2009 Share Posted November 2, 2009 Oops, made a typo. You might want to copy again. Link to comment https://forums.phpfreaks.com/topic/179886-solved-need-to-execute-mysql-query-with-php/#findComment-948990 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.