Log in

View Full Version : Error SQL: newbie question.



Orange
10-28-2008, 06:21 PM
Hi

This is a newbie question.

We have a website that is now showing

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in .....php on line 12, amongst others. also does not load the home page because of this.

However our web design guy is not around..

could someone tell me if the website error is most likely to be down to the scripting? the reason being that the website hasnt been touched so to speak. just have control over one page to upload resources (PDF files). we're confused how this could have happened. the domain host says that there is nothing wrong there end and it is a scripting issue.

also, given that we cant get hold of our web design guy, what problems would we encounter in transferring the web domain side of things to a new company? for example, we dont have the original code or template. Must apologise, dont know too much about website. so would we need to get hold of the template or code? I understand how Dreamweaver works e.g. design and then upload. is this the same for PHP?

thank you. i must apologise for not showing the website URL. just concerned about spamming. perhaps i am being over cautious.

thank you in advance

JasonDFR
10-28-2008, 06:56 PM
Tough to give a definitive answer without seeing the php code, but it does sound like a scripting issue. As for how it happened since nothing has been changed? Who knows....

As for changing the domain or where you host your website, you should definitely access your hosting account and download everything that is there. As long as you have the files, you'll be able to put them online where ever you want.

If you don't know how to do this, contact the technical support of your web hosting company and they should provide instructions.

Good luck!

J

olveyphotodesign
10-28-2008, 07:08 PM
Can you post the portion of the code that is throwing the error? This would allow us to see what is being supplied to MySQL via PHP.

Additionally, if everything worked on previous domain server, I would ensure that your connection works for the database. Check your MySQL connections point to the correct database that you are pulling from. These variables should be stated before the MySQL query is executed.

A "or die" clause in the script would result in the error being displayed and a blank screen.

Hope this helps.
Ben

Orange
10-28-2008, 08:48 PM
thank you for the replies. they are really helpful. I dont have the login details for the website in terms of the webspace, but soon as i get these details i will login and get the information (code) and post here. Obviously, we intend to get a professional to take over the website/hosting but it is really helpful to have some clue as to what is going on.

again, thank you for taking the time to reply. your're all a credit to this forum.

Orange
10-28-2008, 09:09 PM
actually just found the login details for the webspace, this is taken from the index page. hope someone can see where the problem lies! Apparently there are error on line 12, 146 and 150.


removed code to ensure no attack on website!

olveyphotodesign
10-29-2008, 01:09 AM
/**
* Gets core libraries and defines some variables
*/
require_once('./libraries/common.lib.php');

/**
* Includes the ThemeManager if it hasn't been included yet
*/
require_once('./libraries/relation.lib.php');


Without really seeing it, I believe that your error is coming from one of these two files. I would look in the common.lib.php file first.

Line 12 in this file is a commented section if I'm reading it correctly.

Ciao,
Ben

Orange
10-29-2008, 08:39 AM
Without really seeing it, I believe that your error is coming from one of these two files. I would look in the common.lib.php file first.

Line 12 in this file is a commented section if I'm reading it correctly.

Ciao,
Ben

edit ***oops see what you mean***

Also, is there any way to disable these functions for now?

thank you.

olveyphotodesign
10-29-2008, 06:11 PM
Okay, You're problem is out of my league. I would not post your entire library file, most likely you would expose some security issue that would aid others in hacking your site.

With that said, you can try using a find command in your text doc for the function that is throwing the error and then look in that area of your code for the possible problem.

Good Luck,
Ben