note 70626 deleted from ref.mysql by betz
| From: | betz@php.net | Date: | Sun, 22 Oct 2006 09:36:52 +0000 |
| Subject: | note 70626 deleted from ref.mysql by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-118954@lists.php.net to get a copy of this message | ||
Note Submitter:
Reason: useless
----
Heres a simple code to show how to query data from a database
<?php
//connect
$con = mysql_connect("localhost","usernmae","password");
if(!$con){ echo mysql_error(); }
//pick database
mysql_select_db("database_name", $con);
//database query
$result = mysql_query("SELECT
pdedecker FROM votes WHERE
id = '0'", $con) or die(mysql_error());
//fetch
while($row= mysql_fetch_array($result))
{
$getrating_rating = $row['pdecker'];
}
//close connection
mysql_close($con);
?>