Jump to content

Archived

This topic is now archived and is closed to further replies.

Guest ShaneLarson

MySQL Question

Recommended Posts

Guest ShaneLarson
What do you edit to [code]or die ("");[/code] to display what the error is caused off of.

Share this post


Link to post
Share on other sites
[code]<?php
$result = mysql_query('SELECT * WHERE 1=1');
if (!$result) {
    die('Invalid query: ' . mysql_error());
}

?>[/code]

Share this post


Link to post
Share on other sites
No need to run an IF test, the one-line version

$sql = mysql_query("select * from table") or die(mysql_error());

Share this post


Link to post
Share on other sites

×

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.