close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Error end of the page when recordset is empty

Thread began 5/04/2015 4:49 pm by Kumel | Last modified 5/05/2015 2:42 pm by Ray Borduin | 813 views | 6 replies |

Kumel

Error end of the page when recordset is empty

I receiving an error at the bottom of the page as:

Warning: mysql_free_result() expects parameter 1 to be resource, null given in /home/content/39/10368039/html/shrishtiartgallery/other-style-artworks.php on line 460


page is live here:

http://www.shrishtiart.com/other-style-artworks.php

THis error seems to appear only when recordset is empty.

File attached.

Sign in to reply to this post

Ray BorduinWebAssist

This error occurs because your ArtistName recordset is inside of a repeat region... so if there are no results the recordset doesn't end up being created.

The solution is probably to move the mysql_free_result() line from that recordset inside of the repeat region as well.

So move this line:
mysql_free_result($ArtistName);

inside of the repeat region just before line 335

Sign in to reply to this post

Kumel

i added on attached file. error doesnt seem to appear. but when i add to the to another page ie: where RS is not empty then shows another error.

<br />
<b>Warning</b>: mysql_fetch_assoc(): 12 is not a valid MySQL result resource in <b>/home/content/39/10368039/html/shrishtiartgallery/drawing-artworks.php</b> on line <b>345</b><br />
<br />
<b>Warning</b>: mysql_fetch_assoc(): 12 is not a valid MySQL result resource in <b>/home/content/39/10368039/html/shrishtiartgallery/drawing-artworks.php</b> on line <b>345</b><br />

Sign in to reply to this post

Ray BorduinWebAssist

I see... yes you can't free the result there because it is referred to again lower.

Move the code back to the bottom of the page and wrap it in an if statement instead like:


if (isset($ArtistName)) {
mysql_free_result($ArtistName);
}

Sign in to reply to this post

Kumel

to which line? shud i add these :

if (isset($ArtistName)) {
mysql_free_result($ArtistName);
}

i added at 340 line now. (file attached)

yet i m getting an error.

Sign in to reply to this post

Ray BorduinWebAssist

That code is right, but it needs to be moved back to the bottom of the page where it was before.

Sign in to reply to this post

Kumel

awesome (y)

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...