Christopher Bergin 1 Posted July 21, 2012 Report Share Posted July 21, 2012 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 . Quote Link to post Share on other sites
Edward 108 Posted July 22, 2012 Report Share Posted July 22, 2012 Your database setting are wrong. Quote Link to post Share on other sites
Christopher Bergin 1 Posted July 22, 2012 Author Report Share Posted July 22, 2012 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); Quote Link to post Share on other sites
Larry 433 Posted July 23, 2012 Report Share Posted July 23, 2012 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. Quote Link to post Share on other sites
Recommended Posts
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.