-
Ok, here is something simple
<?php
//Database user name
$username = "pee_wee";
//Database password
$password = "let_me_in";
//Leave this as it is
$hostname = "localhost";
//Run Connection Script!
$connect = mysql_connect($hostname, $username, $password)
or die("Unable to connect to MySQL");
//Inserting into mysql database
$query = mysql_query("INSERT INTO `your_table` (`field1`, `field2`) VALUES ('$value1', '$value2')");
//Close Connection
mysql_close($connect);
?>
<?php
//Database user name
$username = "pee_wee";
//Database password
$password = "let_me_in";
//Leave this as it is
$hostname = "localhost";
//Run Connection Script!
$connect2 = mysql_connect($hostname, $username, $password)
or die("Unable to connect to MySQL");
//Getting data - This will dispay all records
$qe = mysql_fetch_array("select * from `your_table`");
while($query = mysql_query($qe)) {
print "Field1: $query[field1]
";
print "Field2: $query[field2]
";
}
//Close Connection
mysql_close($connect2);
?>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks