Jump to content


Photo

Indexing a recordset


  • Please log in to reply
2 replies to this topic

#1 recset

recset
  • Members
  • PipPip
  • Member
  • 29 posts

Posted 10 September 2006 - 02:50 PM

I know this is a simple answer, and maybe because i have been glued to the computer is the reason why i can't see it, so here is the problem:

$query_ldevices = "SELECT * FROM literary_devices_hold WHERE MAXIMID = ID";

-- I want to change 'ID' to $row_Recordset1['ID'] from a table called 'wisdom';

The purpose is that for the MAXIMID's in the literary_devices_hold table to only show information for each recordset in table ID, as long as the MAXIMID'S and ID's are identical.

Can anyone help?

#2 HuggieBear

HuggieBear
  • Members
  • PipPipPip
  • Advanced Member
  • 1,899 posts
  • LocationEngland, UK

Posted 10 September 2006 - 07:57 PM

I'm not sure I understand exactly, but if I do, then try this bit of code.

If it doesn't give the result you're expecting, we may need some additional clarification as to what you're after.

$sql = "SELECT * FROM literary_devices_hold WHERE maximid = (SELECT max(id) FROM wisdom)";

Regards
Rich
Advice to MySQL users: Get phpMyAdmin and test your queries work there first, take half the hassle out of diagnosis, also check the reserved words list.

Links: PHP Docs :: RegEx's :: MySQL :: DevGuru :: w3schools

#3 recset

recset
  • Members
  • PipPip
  • Member
  • 29 posts

Posted 10 September 2006 - 08:27 PM

That actually works, thanks for the help!






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users