Jump to content

How to handle sql errors?


zeus68
 Share

Recommended Posts

I use this code to connect to my access database that's sat on a XP machine (no sql server) it's a dsn-less connection

<?

$conn = new COM("ADODB.Connection") or die("Cannot start ADO");

$conn->Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=dvd.mdb");

 

//$conn->Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=$db");

$rs = $conn->Execute("SELECT * FROM dvd WHERE title LIKE '%$title%' ORDER BY title");

?>

 

I need to display something like "no movies found" if the search aql query returns no fields.

 

For some reason some of the sql statements don't seem to work. i.e. if I add above to the sql query the TOP 10 next to the select statement it works fine but if I also add START 10,10 doesn't

 

Any ideas?

Link to comment
Share on other sites

This thread is more than a year old.

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.

 Share

×
×
  • 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.