Jump to content

[SOLVED] Need to execute mysql query with php


DiscoTrio

Recommended Posts

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

<?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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.