Return to iWEBTOOL

Go Back   iWEBTOOL Talk > The Web and your Website > Programming > PHP > MySQL
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
 
Welcome to iWEBTOOL Talk, where you talk about webmaster-related stuff.
 
Discuss topics which interest you.
With over thousands of threads (topics), we're sure you'll find something that'll interest you.
Ask for help whenever you need it.
We have thousands of members who are available to help you if you need it.
It's absolutely FREE!

 1  Register           2  Browse the board           3  Discuss whatever may interest you!
 


Closed Thread
 
Thread Tools Search this Thread Display Modes
Old 11-23-2007, 05:43 AM   #1
LordOrange
Newcomer
 
LordOrange's Avatar
 
Join Date: Nov 2007
Posts: 13
LordOrange is on a distinguished road
Default localhost

I've just set up a localhost with Apache. I've installed PHP and MYSQL. I downloaded a database manager and it connects to the database fine with username-root
password-orange
server-localhost

but when I run a php script to connect:
PHP Code:
$con mysql_connect("localhost","root","orange");

mysql_select_db("mysql"$con);
$result mysql_query("SELECT * FROM info");
while(
$row mysql_fetch_array($result))
{
echo 
"123 <br>";

echo 
$row['name']." ".$row['age'];

echo 
"<br>";
}
mysql_close($con); 
nothing happens. I am sure the database (mysql) and table in it (info) are correct aswell as the row names. Can anyone help me understand what I'm doing rong?
LordOrange is offline  
 
This is an Ad Revenue Sharing forum Place your advert here
SEO Checklist
Get yourself better ranking with
our "Do-it-Yourself" SEO Checklist.
Click Here
Old 11-23-2007, 02:56 PM   #2
UnKnown
Moderator
 
UnKnown's Avatar
 
Join Date: Aug 2006
Posts: 1,128
UnKnown is just really niceUnKnown is just really niceUnKnown is just really niceUnKnown is just really niceUnKnown is just really nice
Default Re: localhost

never mind i posted something wrong you can delete this
but did you set a root password? If not leave it blank when connecting as root
UnKnown is offline  
Old 12-03-2007, 02:22 AM   #3
hasan_889
iWEBTOOL Moderator
 
hasan_889's Avatar
 
Join Date: Aug 2006
Location: London
Posts: 1,186
hasan_889 has a spectacular aura abouthasan_889 has a spectacular aura about
Send a message via MSN to hasan_889 Send a message via Yahoo to hasan_889 Send a message via Skype™ to hasan_889
Default Re: localhost

R u sure -

1. you confired MySQL with Apache properly?
2. MySQL is running?
3. Your php file is in right directory?

Check those question first, your coding looks alright to me.

Best of Luck!
hasan_889 is offline  
 
This is an Ad Revenue Sharing forum Place your advert here
Webmaster Tools Webmaster Tools Click Here
Closed Thread

(Threads which have no activity for more than 30 days are automatically closed.)



Quick Reply
Message:

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Forum Jump


All times are GMT. The time now is 05:41 AM.


Powered by vBulletin v3.6.7 © 2008, Jelsoft Enterprises Ltd. SEO by vBSEO © 2006, Crawlability, Inc.