Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Really annoying new error php MySQL

Explorer ,
Apr 24, 2007 Apr 24, 2007

Copy link to clipboard

Copied

Hi guys.

This is a new error. My dynamic page has been working lovely for 2 weeks till today. I have a php page with 2 recordsets, and two divs that display records from them. Previously I had one recordset with a repeating region that showed all records. My second one showed 3 records only. This worked great.

Now i realised that in some cases, the first recordset would or may have quite a few records, more than Id wish to display at one time in my div (its quite narrow, so made the page really long, also wasn't very readable for more than say 5 records.) . So i decided to change the repeating region to display 5 records at a time, and add a navigation element so the user could flick through the recordset, and the div wouldnt be stretched too large.

I did this and it worked fine on my local testing machine. I uploaded the changed file to the remote server and got this error when I looked at the page: mysql_num_rows(): supplied argument is not a valid MySQL result resource in [path of file] on line [line that included the 1st instance of mysqlnumrows()]

I've tried to dismatle the changes i made, but still keep getting the error. So i removed ALL the php from the page and started from scratch in order to try and find the point wherer things stopped working . The following code sample is where i was upto when the error reared its ugly head again.

Sorry for the long message. Hope you lot can help, you normally can! Thanks in advance.

Dave
TOPICS
Server side applications

Views

282
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , Apr 24, 2007 Apr 24, 2007
ok now i feel a bit stupid.....

it was down to my connection script: how Dreamweaver (still!) automatically uses pconnect() to connect to a database and my hosting company has disabled it. Quick change to connect() and upload the connection script and all is fine. I don't see why it was changed though because I didn't change the connection. Ah well. Still doesn't explain the error messages, but removes them.

Votes

Translate
Explorer ,
Apr 24, 2007 Apr 24, 2007

Copy link to clipboard

Copied

right...

I've been scouring other forums for a solution to this.

I've added

or die("<br />". mysql_error())

to the line in question to get a more detailed error message and I get a very simple "Table 'pluggy_monthlyevents.NewsItems' doesn't exist" error.

It doesn't exist.. and it shouldn't be asking for that table. monthly_events is database 2 and NewsItems is a table in pluggy_SiteNews (database number 1). Anyone know why the code is being mucked up somwhere when I add the second recordset???? (the second recordset uses pluggy_monthlyevents)

Thanks..... will keep posted

Dave

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 24, 2007 Apr 24, 2007

Copy link to clipboard

Copied

LATEST
ok now i feel a bit stupid.....

it was down to my connection script: how Dreamweaver (still!) automatically uses pconnect() to connect to a database and my hosting company has disabled it. Quick change to connect() and upload the connection script and all is fine. I don't see why it was changed though because I didn't change the connection. Ah well. Still doesn't explain the error messages, but removes them.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines