RE: [PHP] trouble reading a database (fwd)

From: Date: Tue, 24 Apr 2001 01:30:28 +0000
Subject: RE: [PHP] trouble reading a database (fwd)
Groups: php.db 
Request: Send a blank email to php-db+get-8828@lists.php.net to get a copy of this message
---------- Forwarded message ---------- Date: Mon, 23 Apr 2001 20:19:57 -0500 (CDT) From: johndmiller <john@mn.mediaone.net> To: Jason Murray <Jason.Murray@melbourneit.com.au> Cc: php-general@lists.php.net 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: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.db (#8828) next »