Jump to content


Photo

Does the row exist?


  • Please log in to reply
3 replies to this topic

#1 SkullMaster

SkullMaster
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 17 May 2006 - 04:48 PM

Can anyone tell me if there is a mysql command to search for a row number in a mysql table? im working on a file upload site and displaying the file info. I recently added the admin's delete feature that deletes the row from the mysql table, and now i have missing rows and get errors when i try to display the file info.

Warning: mysql_result(): Unable to jump to row 19 on MySQL result index 24 in /home/skullmas/public_html/working/admin2.php on line 99

i was just looking for something that would let me see if row 19(for example) was in the table before it tried to get the data that doesnt exist from it.

Thanks

#2 semtex

semtex
  • Members
  • PipPip
  • Member
  • 11 posts

Posted 18 May 2006 - 10:35 AM

Why don't you search for the ID of that row? And if it exists, then delete the row?

#3 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 18 May 2006 - 05:11 PM

[!--quoteo(post=374717:date=May 17 2006, 12:48 PM:name=SkullMaster)--][div class=\'quotetop\']QUOTE(SkullMaster @ May 17 2006, 12:48 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Can anyone tell me if there is a mysql command to search for a row number in a mysql table? im working on a file upload site and displaying the file info. I recently added the admin's delete feature that deletes the row from the mysql table, and now i have missing rows and get errors when i try to display the file info.
[/quote]
How is that even possible? What query are you running that returns deleted rows?
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

#4 SkullMaster

SkullMaster
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 18 May 2006 - 09:43 PM

i got it working. i queried for a row with the id then checked the number of rows returned. 0=doesnt exist and 1=exists :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users