Jump to content

dredge

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

dredge's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hello, I have a MySQL database table that will hold 2500 records to begin with and will grow to maybe 10,000 records in the next few years. My question is: is it possible for query arrays to hold that many records? Here\'s an example: $check="SELECT * From Users"; $result=mysql_query($check); $row=mysql_fetch_array($result); In the above example, if there are 10,000 records in the Users table, then from my understanding $result will get VERY big. Are there limits on how large $result can get? Is there a better way to retrieve the records than this? I am planning on displaying 10-20 records per page, but I figure that I need to get them all first and store them in a session until needed. Is there a better way to do this? Thanks
  2. Hello, I\'m new to SQL and have run across a problem. First of all, here is the complete SQL code that results in an error: SELECT WC_First_Name, WC_Last_Name, WC_SSN, WC_Availability_Type FROM Worker_Client WHERE WC_City = \'Sacramento\' AND WC_State = \'CA\' AND WC_HS_Status = 1 AND WC_College_Status = 2 AND WC_SSN IN(SELECT WC_SSN FROM WC_Skill Where Skill_ID IN(\'1166\',\'1198\',\'1180\')) AND WC_SSN IN(SELECT WC_SSN FROM WC_Certificate Where Certificate_ID IN(\'1001\',\'1003\',\'1007\',\'1008\')) When I run this code, I get this error: MySQL said: You have an error in your SQL syntax near \'SELECT WC_SSN FROM WC_Skill WHERE Skill_ID IN ( \'1166\', \'1198\', \'1180\' ) ) AN\' at line 5 The weird thing is that this code works fine when I exchange the insides of the two IN Statements with a test number like \'1004\'. For example, this code works: SELECT WC_First_Name, WC_Last_Name, WC_SSN, WC_Availability_Type FROM Worker_Client WHERE WC_City = \'Sacramento\' AND WC_State = \'CA\' AND WC_HS_Status = 1 AND WC_College_Status = 2 AND WC_SSN IN ( \'1004\' ) AND WC_SSN IN ( \'1004\' ) Another weird thing is that the code that I just took out in the previous example runs fine on its own. For example, these two pieces of code (from inside the IN Statements) works just fine by themselves: SELECT WC_SSN FROM WC_Skill WHERE Skill_ID IN ( \'1166\', \'1198\', \'1180\' ) SELECT WC_SSN FROM WC_Certificate WHERE Certificate_ID IN ( \'1001\', \'1003\', \'1007\', \'1008\' ) I am using PHP 4.1.2 and MySQL 3.23.39 Thanks in advance. : )
×
×
  • 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.