Jump to content

Need help with MySQL


Brain In Vat

Recommended Posts

This is the code I am using:

<?php
$dbh=mysql_connect ("localhost", 'user', "password") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("user_data", $dbh);

$sql = "select lname from experiment fname='Jouko'";
$result = mysql_query ($sql) or die (mysql_error().$sql);
$b_row = mysql_fetch_array($result);
?>

This is the result:

Warning: mysql_connect(): Access denied for user: 'user@delta.sitelutions.com' (Using password: YES) in /home/bill5040/public_html/Test/sql.php on line 2
I cannot connect to the database because: Access denied for user: 'user@delta.sitelutions.com' (Using password: YES)

I changed some things for security purposes.
Link to comment
Share on other sites

I made a couple of changes and now I get the error:

You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '='Jouko'' at line 1select lname from experiment fname='Jouko'

How do I find the manual that correspond to my MySQL server? How do I find out my MySQL server version?
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.