Forum     

Go Back   Digit Technology Discussion Forum > Software > Programming
Register FAQ Calendar Mark Forums Read

Programming The destination for developers - C, C++, Java, Python and the lot


Closed Thread
 
LinkBack Thread Tools Display Modes
Old 11-09-2008, 09:54 AM   #1 (permalink)
Right Off the Assembly Line
 
Join Date: Nov 2006
Location: Mumbai
Posts: 31
Exclamation Connection to mySQL through PHP


Dear Digiterzz!!

I'm trying to create a connection between mySQL database through PHP but I'm not able to do so..
Check out the following code:

<?php
$dbhost = 'mysql2.freehostia.com';
$dbuser = 'db_User';
$dbpass = 'admin';

$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die('Error connecting to mysql');

$dbname = 'db_Rakshak';
mysql_select_db($dbname);
?>


Please help!!
Thanks
__________________
Thanks and Regards,
Prathamesh R. Tawde
prathamtawde is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 11-09-2008, 02:51 PM   #2 (permalink)
Right Off the Assembly Line
 
Join Date: Nov 2006
Location: Mumbai
Posts: 31
Default Re: Connection to mySQL through PHP

Quote:
Originally Posted by vikas12345 View Post
please post the error msg you are getting while connecting mysql to php
blank web page appears..

Quote:
Originally Posted by prathamtawde View Post
blank web page appears..
Not Found

The requested URL /test.php was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Apache/1.3.33 Server at prathamtawde.freehostia.com Port 80
__________________
Thanks and Regards,
Prathamesh R. Tawde

Last edited by prathamtawde; 11-09-2008 at 02:57 PM. Reason: Automerged Doublepost
prathamtawde is offline  
Old 11-09-2008, 03:49 PM   #3 (permalink)
God of Mistakes...
 
Garbage's Avatar
 
Join Date: Dec 2005
Location: Pune, Maharashtra
Posts: 1,923
Default Re: Connection to mySQL through PHP

If a 404 error, then it's not your code problem. Check the path of file and put the address according to that.
__________________
Registered Linux User #468778
----------------------------------
http://twitter.com/_Garbage_
Garbage is offline  
Old 11-09-2008, 05:57 PM   #4 (permalink)
Addicted to FOSS
 
ManishSinha's Avatar
 
Join Date: Jan 2008
Location: Manipal
Posts: 32
Default Re: Connection to mySQL through PHP

You are trying to run this code on your system locally or on the freehostia's hosting service?
ManishSinha is offline  
Old 11-09-2008, 07:22 PM   #5 (permalink)
18 Till I Die............
 
Join Date: Jul 2004
Location: India, Mumbai, Marine Lines
Posts: 5,792
Default Re: Connection to mySQL through PHP

What is more recommended to use - mysql_connect or pear mdb2? And why?
__________________
http://www.bash.org/?258908
mehulved is offline  
Old 11-09-2008, 07:40 PM   #6 (permalink)
Addicted to FOSS
 
ManishSinha's Avatar
 
Join Date: Jan 2008
Location: Manipal
Posts: 32
Default Re: Connection to mySQL through PHP

Quote:
Originally Posted by mehulved View Post
What is more recommended to use - mysql_connect or pear mdb2? And why?
I personally prefer mysql_connect

pear mbd2 may be your choice...
ManishSinha is offline  
Closed Thread

Bookmarks

Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mysql Help Desi-Tek.com Open Source 4 27-11-2006 12:24 PM
help in PHP-mysql bukaida Open Source 7 08-11-2006 03:20 PM
php and mysql arunks QnA (read only) 3 12-08-2006 07:58 PM
connection of PHP & MySQL Trinity QnA (read only) 9 24-07-2005 11:47 AM
MySql Administrator , connection prob ! help Butterfly QnA (read only) 1 07-10-2004 08:30 PM

 
Latest Threads
- by clinton
- by soumya
- by Sujeet
- by clmlbx

Advertisement




All times are GMT +5.5. The time now is 11:12 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2