LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-25-2008, 12:50 AM   #1
SuMoNiNa
LQ Newbie
 
Registered: Mar 2008
Posts: 9

Rep: Reputation: 0
Unhappy unable to open a php script embedded with mysql from client (remotely)


Hi,

I am trying to access a mysql database using php from the client. other php pages without mysql embeded within are working fine.

my php code is


<?php
$link = mysql_connect("192.168.168.141", "sm", "ninanina")
or die ("could not connect :" . mysql_error());
print " Connected Successfully \n\n";
mysql_select_db ("test") or die ("could not select database");

$query = "Select * from persons";
$result = mysql_query($query)
or die ("query failed : " . mysql_error());

print "<tables> \n";
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
print "\t <tr> \n";
foreach ($line as $col_value) {
print "\t\t<td> $col_value <\td> \n";
}
print "\t <\tr> \n";
}
print "<\t <\tr> \n";
mysql_free_Results($result);
mysql_close($link);
?>



the error i am getting from the remote machine is "page cannot be displayed"

hoping for an early response.

thanks in advance,
 
Old 10-25-2008, 08:38 AM   #2
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
Please put your code between [ code] or [ php] tags. That makes it easier to read for us.

If that is the error message you get, it has not anything to do with MySQL. The page is not displayed at all, not even an error message from your page itself.

Most likely the permissions are not set correctly (most be world readable), or the file is not there.

jlinkels
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Good embedded system NAS with NFS, PHP/MySQL telecomkid Linux - Embedded & Single-board computer 0 09-16-2007 05:15 AM
LXer: Title: PHP/MySQL Classifieds Script AddAsset1.php Script Insertion LXer Syndicated Linux News 0 07-02-2006 06:21 PM
non embedded php script lord-fu Programming 3 10-10-2005 11:33 PM
Shutdown the System remotely via PHP-Script? linuxuser2005 Linux - General 2 08-30-2004 11:53 AM
RH: Trying to make script to remotely modifie mysql db. paulvl Linux - General 1 12-05-2003 10:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration