PDA

View Full Version : MySql



chris9902
May 23rd, 2003, 02:08 PM
i need to no HOW TO CREATE A MySql file or how to access it

i need to no what to do with a MySql database



$host = "localhost";
$username = "thename";
$password = "mypsw";
$database = "ApronBase";
$server = mysql_connect($host, $username, $password);
$connection = mysql_select_db($database, $server);


Host: my host is http://www.myjspace.com/
User: that is gta.to-j.com
Pass: well you not using that:smirk:
Database: WHAT IS THAT :cyclops:

and the rest

here is the full code i want to use


//connecting to the db
$host = "localhost";
$username = "apron";
$password = "apron123";
$database = "dbHits";
$server = mysql_connect($host, $username, $password);
$connection = mysql_select_db($database, $server);

//get the recordset with SQL
$rs = mysql_query("SELECT * FROM tbHits");
$viewers = 0;
//update the table
if($row=mysql_fetch_assoc($rs))
{
$viewers = $row[Viewers] + 1;
}

//update the tbHits table
$sql = mysql_query("UPDATE tbHits SET Viewers = '$viewers'");

//close the db connection
mysql_close($server);

//display the viewers
echo($viewers);

Jubba
May 24th, 2003, 12:41 AM
Get this book:

http://www.amazon.com/exec/obidos/tg/detail/-/0764535617/qid=1053751242/sr=8-1/ref=sr_8_1/002-2551283-1162431?v=glance&s=books&n=507846

I really can't help you until you have some understanding of what you are dealing with.


I also suggest this book as well:

http://www.amazon.com/exec/obidos/tg/detail/-/0764516922/qid=1053751276/sr=1-2/ref=sr_1_2/002-2551283-1162431?v=glance&s=books

ahmed
May 24th, 2003, 12:45 AM
if you don't know anything about mysql and trying to implement it, then do what jubba suggested.. :)

anywho, you can have many databases on your mysql server, and therefore you need to specify which database are you dealing with..