[NTLUG:Discuss] Looks like PHP + MYSQL is working but now I'm getting another problem (MYSQL)
asenec@senechalle.net
asenec at senechalle.net
Fri May 19 23:31:33 CDT 2000
Make sure that mysql is running and that it is
using the socket at /tmp/mysql.sock.
Annette
> From discuss-admin at ntlug.org Fri May 19 16:51 CDT 2000
> From: "Barker, Bob" <bbarker at caprock.com>
> To: "'discuss at ntlug.org'" <discuss at ntlug.org>
> Subject: RE: [NTLUG:Discuss] Looks like PHP + MYSQL is working but now I'm
> getting another problem (MYSQL)
> Date: Fri, 19 May 2000 16:48:46 -0500
> MIME-Version: 1.0
> X-Mailman-Version: 1.0
> List-Id: NTLUG Discussion List <discuss.ntlug.org>
> X-BeenThere: discuss at ntlug.org
>
> I'm not 100% here but I think you need to add the password field to your
> connection string even if it's blank.... I don't know if you need double or
> single quotes though.
>
> $dbc = mysql_connect('localhost', 'root','');
>
>
>
> Bob
>
> -----Original Message-----
> From: hector M Banda [mailto:hector at need-info.com]
> Sent: Friday, May 19, 2000 4:37 PM
> To: discuss at ntlug.org
> Subject: [NTLUG:Discuss] Looks like PHP + MYSQL is working but now I'm
> getting another problem (MYSQL)
>
>
>
> Warning: MySQL Connection Failed: Can't connect to local MySQL server
> through socket '/tmp/mysql.sock' (111) in /home/httpd/html/second.php3 on
> line 4
>
> Warning: 0 is not a MySQL link index in /home/httpd/html/second.php3 on line
> 5
>
> Warning: 0 is not a MySQL link index in /home/httpd/html/second.php3 on line
> 6
>
> Warning: 0 is not a MySQL result index in /home/httpd/html/second.php3 on
> line 7
> First Name:
>
> Warning: 0 is not a MySQL result index in /home/httpd/html/second.php3 on
> line 8
> Last Name:
>
> Warning: 0 is not a MySQL result index in /home/httpd/html/second.php3 on
> line 9
> Address:
>
> Warning: 0 is not a MySQL result index in /home/httpd/html/second.php3 on
> line 10
> Position:
>
> This is the actual code:
>
> <html>
> <body>
> <?php
> $db = mysql_connect("localhost", "root");
> mysql_select_db("mydb",$db);
> $result = mysql_query("SELECT * FROM employees",$db);
> printf("First Name: %s<br>\n", mysql_result($result,0,"first"));
> printf("Last Name: %s<br>\n", mysql_result($result,0,"last"));
> printf("Address: %s<br>\n", mysql_result($result,0,"address"));
> printf("Position: %s<br>\n", mysql_result($result,0,"position"));
> ?>
> </body>
> </html>
>
>
> Thanks,
> --
>
>
> ===========================================
> Hector M Banda
> Senior Computer Programmer
> Information Systems Department
> Imperial Valley College
> Imperial Ca, 92251
> Phone: 760.355.6105
> Fax : 425.790.6379
> ============================================
>
>
> _______________________________________________
> http://ntlug.org/mailman/listinfo/discuss
>
> _______________________________________________
> http://ntlug.org/mailman/listinfo/discuss
>
More information about the Discuss
mailing list