$link = mysql_connect('hostname','username','password');
/* You can use mysql_pconnect there with the same parameters if you want a persistant connection to the database */
mysql_select_db('dbname',$link);
/* dbname being of course, the name of your MySQL database */
$query = "INSERT INTO blah VALUES('blah','blah'";
/* or whatever SQL statement you had in mind */
If you are making a select statement, then the mysql_query function return should be assigned to some variable (this return is what's known as a result id) and that variable can be used with functions such as mysql_result, mysql_fetch_row and mysql_fetch_array (my personal favorite Hope this helps. Later.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.