|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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? |
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
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).] |
|
#4
|
|||
|
|||
|
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.
|
![]() |
| Viewing: Dev Shed Forums > Databases > MySQL Help > Connect OK!! Select database - Not OK :-( |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|