GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 27-May-2005, 22:53
vladimy vladimy is offline
New Member
 
Join Date: May 2005
Posts: 2
vladimy is on a distinguished road

php and mysql


php and mysql is working fine in my window xp but i am unable to
to connect it to my database and i need help. i did not set up a password for mysql and what should do in this case?

PHP Code:

<html>
<head>
<title>mysql test</title></head>
<body>
<h1>
<? php 
$connection=mysql_connect("localhost","root","password")
or die("could not connect to mysql");
echo "successfully connected to mysql";
?>
</h1>
</body>
</html> 

Last edited by LuciWiz : 28-May-2005 at 11:13. Reason: Please insert your PHP code betweeen [php] & [/php] tags
  #2  
Old 28-May-2005, 01:30
mrkamran mrkamran is offline
New Member
 
Join Date: Feb 2004
Posts: 15
mrkamran is on a distinguished road

php and mysql


Hi,
Can u plz tell me the right process to configure php on my winxp
i m trying to configure it for several days but it could not execute php script.
how did u configure it?

thanks!
  #3  
Old 28-May-2005, 05:17
developerszone developerszone is offline
New Member
 
Join Date: May 2005
Posts: 2
developerszone is on a distinguished road

Hmmmmmmmmmmmm


Hello,
1. vladimy if u don't set up your password it woun't allow to connect
2. Are you doing this on your PC or on your webserver.
3. if it is on your webserver.. you gonna create a DB and use your php code. to connect to it,, hehe i guess u could do that.
take a look at this... this example on your web host server
PHP Code:

<?php
include ('dbconn.php');

$connection = mysql_connect ("localhost", "dbpassword","password");
or die ("cannot connect to server");  mysql_error ());
echo 'Connected to database succesfully.
$db = mysql_select_database ("database_name", $connection");
or die ('cannot connect to database'): mysql_error ());

?>


But if you wanna connect from you machine.. you must set your root password.
Last edited by LuciWiz : 28-May-2005 at 11:15. Reason: Please insert your PHP code between [php] & [/php] tags
 
 

Recent GIDBlogLast Week of IA Training by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

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 Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP, MySQL, WML skyloon MySQL / PHP Forum 0 05-Mar-2004 07:53
FREE 25 MB, No Ads, Control Panel, ASP, ColdFusion, PHP, MySQL, Access Hosting rkmails Free Web Hosting 0 08-Sep-2003 05:49
[script] Password Protect web pages/site using PHP and MySQL JdS PHP Code Library 0 23-Jul-2003 10:02
Windows: From only £20p/y,Linux: from $10p/m. ASP, ASP.NET, PHP, Free MySQL, +More EyotaHosts Web Hosting Advertisements & Offers 0 28-Jun-2003 13:54

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 01:24.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.