note 56525 added to function.mysql-pconnect

From: Date: Tue, 06 Sep 2005 10:13:11 +0000
Subject: note 56525 added to function.mysql-pconnect
Groups: php.notes 
Request: Send a blank email to php-notes+get-94804@lists.php.net to get a copy of this message
Why i can't connect to my MySQL database by using the following script: <html> <head> <title> PHP Test </title> </head> <body> <?php $link = @mysql_pconnect("localhost","Ping","123") or die("cannot connect to localhost".mysql_error()); mysql_select_db(test) or die("cannot connect to the database".mysql_error()); $result = mysql_query("SELECT * FROM student") or die("cannot execute the query"); print("<table>\n"); while ($row = mysql_fetch_row($result)) { print("<tr>\n"); for ($i=0;$i<mysql_num_fields($result);$i++) { printf("<TD>%s</TD>\n",htmlspecialchars($row[$i])); } print("</tr>\n"); } mysql_free_result($result); print("</table>\n"); ?> </body> </html> could anyone here help me? ---- Manual Page -- http://www.php.net/manual/en/function.mysql-pconnect.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+56525 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+56525&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+56525&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+56525&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+56525&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+56525&report=yes&reason=non-english Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+56525&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+56525&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#94804) next »