lostcommander
Member
- Messages
- 52
- Reaction score
- 0
- Points
- 6
Okay, I've been beating my head against this for too long and I don't see anything either wrong with my code or of use in searching the forums. I'm sorry as I'm sure this is either a typo or programmer error (e.g. mixing string concatenation . vs + earlier - wrong language, dur...) on my part.
When I do this, I get "Query failed"; however, there is no mysql error attached. The $database, $user, and $password are all correct, and correctly capitalized. :dunno:
$query = "SELECT * FROM table";
$dbconn = mysql_connect(localhost,$user,$password);
if (!$dbconn) {
die('DB connection failed: ' . mysql_error());
}
$selection = @mysql_select_db($database);
if (!$selection) {
die('DB selection failed: ' . mysql_error());
}
$result = mysql_query($query);
if (!$result) {
die('Query failed: ' . mysql_error());
}
When I do this, I get "Query failed"; however, there is no mysql error attached. The $database, $user, and $password are all correct, and correctly capitalized. :dunno:
Last edited: