---------- Forwarded message ---------- Date: Mon, 23 Apr 2001 20:19:57 -0500 (CDT) From: johndmiller <[EMAIL PROTECTED]> To: Jason Murray <[EMAIL PROTECTED]> Cc: [EMAIL PROTECTED] Subject: RE: [PHP] trouble reading a database (fwd) Thanks for the pointer about ' vs ". I have changed my code to used these. The code is a lot cleaner. I am still getting a not found error. Below is the new "cleaner" messages that I display. One point that may be important, FLD_Name and FLD_Path are the primary key. Couple of questions, can I recreate the same key and use just one name (looks like I could) and would this help with the problem. Read_sql SELECT * FROM TBL_Picture WHERE FLD_FileName = 'IceCastle.jpg' and FLD_Path = '/var/www/html/slidecollection/WinterCarnival' Error Results Result of read Resource id #2 Number or Rows 0 Insert Sql INSERT INTO TBL_Picture VALUES ('IceCastle.jpg', '/var/www/html/slidecollection/WinterCarnival', '1984', 'This is a picture of an Ice Castle at night.', 'Ice Castle') Error Results Duplicate entry '/var/www/html/slidecollection/WinterCarnival-IceCastle.jpg' for key 1 Can I set up my primary key On Tue, 24 Apr 2001, Jason Murray wrote: > > Read_sql SELECT * FROM TBL_Picture WHERE FLD_FileName = > > "SailBoat.jpg"and FLD_Path =" > /var/www/html/slidecollection/WinterCarnival" > > This is a little hideous. > > For one thing, you should probably use ' and not ". It may not > make a difference to MySQL, but it does to other databases you > may use in the future. > > For the FLD_Path comparison, you are looking for something that > specifically STARTS with a space. I'd bet this is why the script > is getting 0 rows back - probably none of your FLD_Path's start > with a space. > > Jason > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]