mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
adding mysql_error in example
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@127493 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
310482980f
commit
aedc59eed3
1 changed files with 3 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.15 $ -->
|
||||
<!-- $Revision: 1.16 $ -->
|
||||
<reference id="ref.mysql">
|
||||
<title>MySQL Functions</title>
|
||||
<titleabbrev>MySQL</titleabbrev>
|
||||
|
@ -54,13 +54,13 @@
|
|||
<?php
|
||||
/* Connecting, selecting database */
|
||||
$link = mysql_connect("mysql_host", "mysql_user", "mysql_password")
|
||||
or die("Could not connect");
|
||||
or die("Could not connect : " . mysql_error());
|
||||
print "Connected successfully";
|
||||
mysql_select_db("my_database") or die("Could not select database");
|
||||
|
||||
/* Performing SQL query */
|
||||
$query = "SELECT * FROM my_table";
|
||||
$result = mysql_query($query) or die("Query failed");
|
||||
$result = mysql_query($query) or die("Query failed : " . mysql_error());
|
||||
|
||||
/* Printing results in HTML */
|
||||
print "<table>\n";
|
||||
|
|
Loading…
Reference in a new issue