#6

Код:
<?php
mysql_connect("localhost", "mysql_user", "mysql_password") or
    die("Could not connect: " . mysql_error());
mysql_select_db("mydb");

$result = mysql_query("SELECT id, name FROM mytable");

while ($row = mysql_fetch_array($result, MYSQL_BOTH)) {
    printf ("ID: %s  Name: %s", $row[0], $row["name"]);
}

mysql_free_result($result);
?>
Reply


Messages In This Thread
PHP - by Ghazal - 23.08.2014, 12:04
Re: PHP - by Kyle - 23.08.2014, 12:10
Re: PHP - by Ghazal - 23.08.2014, 12:12
Re: PHP - by Kyle - 23.08.2014, 12:23
Re: PHP - by Ghazal - 23.08.2014, 12:29
Re: PHP - by Kyle - 23.08.2014, 12:36
Re: PHP - by TakeiT - 23.08.2014, 12:44
Re: PHP - by iFarbod - 23.08.2014, 12:58
Re: PHP - by Kyle - 23.08.2014, 13:19
Re: PHP - by KingHual - 23.08.2014, 13:34

Forum Jump:


Users browsing this thread: 2 Guest(s)