Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Connection to WAMP Issue
Old 01-24-2008, 06:04 AM Connection to WAMP Issue
afridy's Avatar
Extreme Talker

Posts: 196
Trades: 0
Hai all,
Hello friends.

I have installed apache, php and MySQL using WAMP version 2.
i can browser the local host, php just works fine. i can connect to the MySql server using Heidi SQL just fine. every thing is ok except i cant connect to the MySQL server using php code. just a blank page appear when i execute the below code. no errror message or anything display at all.

PHP Code:
$link=mysql_connect('localhost','root');

if (!
$link) {
echo
"Cant connect to my_sql server" . mysql_error();
die();
}else{
echo
connected;
}

Only a blank white page appear.
Please help !

Note:- i am using xp with sp2
afridy is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-24-2008, 07:14 AM Re: Connection to WAMP Issue
maxxximus's Avatar
Extreme Talker

Posts: 219
Name: Rob
Location: UK
Trades: 0
PHP Code:
<?php

$host
"localhost";
$user="root";
$password=""// if you've not set password leave as empty string


$link mysql_connect($host,$user,$password);

if (!
$link) {

  die(
'Could not connect: ' mysql_error());



}

echo 
'Connected successfully';

mysql_close($link);

?>
maxxximus is offline
Reply With Quote
View Public Profile
 
Old 01-24-2008, 10:30 AM Re: Connection to WAMP Issue
afridy's Avatar
Extreme Talker

Posts: 196
Trades: 0
Thanks maxxximus
Yes, the prolem really solved
i compare your code with my code and found i have used short tags <? for php notation and which is turned off bydefault

Thanks Lot.
afridy is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Connection to WAMP Issue
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.13573 seconds with 12 queries