Jump to content
Larry Ullman's Book Forums

Recommended Posts

The book mentions that this could happen but doesn't offer any advice.

 

 

Successfully connected to MySQL!

Could not create database because:Access denied for user 'cjbergin'@'10.%' to database 'myblog'

Could not select database because:Access denied for user 'cjbergin'@'10.%' to database 'myblog'

 

 

 

 

 

I seem to be able to manually create databases if I access MySQL from the control panel of the hosting site. When I attempted to manually create 'myblog', I was greeted with a MySQL message indicating that it was already created but yet I don't see it existing in the GUI .

Link to post
Share on other sites

since I'm already discussing Chapter 12, I'll throw this out there. What would be the English translation of this statement?

 

if ($r = mysql_query($query, $dbc))

 

It's obviously not a comparison because the statement doesn't include "==" operator.

 

Also, in the following statement, does the variable $row only hold one record at a time?

 

$row= mysql_fetch_array($r);

Link to post
Share on other sites
I seem to be able to manually create databases if I access MySQL from the control panel of the hosting site. When I attempted to manually create 'myblog', I was greeted with a MySQL message indicating that it was already created but yet I don't see it existing in the GUI .

 

If you're using a hosted site, you almost certainly don't have a database user that has permissions to create new databases via a PHP script. If the hosting panel says the site was created but you don't see it, you'll need to talk to them about it.

 

since I'm already discussing Chapter 12, I'll throw this out there. What would be the English translation of this statement?

 

if ($r = mysql_query($query, $dbc))

 

It's obviously not a comparison because the statement doesn't include "==" operator.

 

Right. The conditional is a bit trickier because it both executes a statement and then evaluates the condition. First the mysql_query() function is called, assigning the result to $r.

 

If the results of the execution are good, then the conditional will be true. This is equivalent to just:

 

$r = mysql_query($query, $dbc);

if ($r) {

 

Also, in the following statement, does the variable $row only hold one record at a time?

 

$row= mysql_fetch_array($r);

 

Yes, exactly.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

Loading...
×
×
  • Create New...