#9

Quote:
Originally Posted by TakeiT
Посмотреть сообщение
You should use Mysqli, not mysql. Mysql is depreciated.
Quote:
Originally Posted by iFarbod
Посмотреть сообщение
Use PDO, Or MySQLi
Код:
<?php
    $con = new mysqli("localhost", "mysql_user", "mysql_password");
    if ($mysqli->connect_errno) { printf("Connect failed: %s\n", $mysqli->connect_error); exit(); }

if($result = mysqli_query($con, "SELECT id, name FROM mytable"))
{

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

mysqli_free_result($result);

}
mysqli_close($con);
?>
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: 1 Guest(s)