MySQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsDatabasesMySQL Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 26th, 1999, 09:12 AM
rwiegmann
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Hi - The following code prints the test message but bombs on the databse selection:

<HTML>
<BODY>
<?
$host="localhost";
$user="myuser";
$password="mypass";
$mysql_link=mysql_connect ($host,$user,$password) or die("Connection failed");
print("This is a test");
$mysql_select_db('joesauto', $mysql_link);
$query="SELECT * FROM joesauto";
$mysql_result=mysql_query($query, $mysql_link);
$mysql_close($mysql_link);
?>
</BODY>
</HTML>

Any ideas?

Reply With Quote
  #2  
Old August 26th, 1999, 09:45 AM
moderator
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
I'm guessing that your problem is most likely in the permissions you have set. Check the db table of the mysql database....there should be one entry that has both the database name 'joesauto' and the desired username. Then you'll need to specify a set of privledges for that user.

Once you are done editing the mysql database you'll need to run 'mysqladmin reload' from the prompt.

For more information on MySQL's privledge system check out:
http://www.devshed.com/Server_Side/MySQL/Administration/page2.html

Or the documentation at:
http://www.devshed.com/Server_Side/MySQL/Manual/manfiles/manual_Privilege_system.html#Privilege_system

Reply With Quote
  #3  
Old August 26th, 1999, 04:07 PM
rwiegmann
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Hi My ISP said that these two statements should NOT have a "$" in front:

$mysql_select_db('joesauto', $mysql_link);
$mysql_close($mysql_link);

Does this make sense? It seems to work - but how can I know when to delete these "$" from examples?



[This message has been edited by rwiegmann (edited 08-26-99).]

Reply With Quote
  #4  
Old August 26th, 1999, 05:25 PM
moderator
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Yes, I'm sorry I didn't look at your code close enough. Your ISP is right....those two statements should not have dollar signs before them.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMySQL Help > Connect OK!! Select database - Not OK :-(

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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 On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap