stilllearning Posted May 25, 2010 Share Posted May 25, 2010 Hi Everyone I have been editing a script to delete customer sites from a MySQL DB. Unfortunately it keeps saying there are no entries in the DB. Yet when I check the entries it is in DB. When looking at the section /*------------------------------------------------------------------------ run the search and show the results ------------------------------------------------------------------------*/ I think the problem is with the line $result = conn($sql); as conn is not declared in this function, although I could be wrong. Can someone please assist and let me know where I am going wrong? TIA [attachment deleted by admin] Quote Link to comment Share on other sites More sharing options...
Bladescope Posted May 25, 2010 Share Posted May 25, 2010 Hi Everyone I have been editing a script to delete customer sites from a MySQL DB. Unfortunately it keeps saying there are no entries in the DB. Yet when I check the entries it is in DB. When looking at the section /*------------------------------------------------------------------------ run the search and show the results ------------------------------------------------------------------------*/ I think the problem is with the line $result = conn($sql); as conn is not declared in this function, although I could be wrong. Can someone please assist and let me know where I am going wrong? TIA It would be safer to edit out your username and password for the sql connection in the text file before you upload it to the net. Looking at the code now. Quote Link to comment Share on other sites More sharing options...
stilllearning Posted May 25, 2010 Author Share Posted May 25, 2010 Forgot about taking that out Luckily it's not root credentials, but I know what you mean! Thanks for the heads up though Quote Link to comment Share on other sites More sharing options...
Bladescope Posted May 25, 2010 Share Posted May 25, 2010 First thing is first, the functions theory is wrong though I can see why you thought that. If a function is declared in the script, it can be used in other functions without needing to be (re)declared in the function it's being used in. Next thing, I need some info. Which of the two no-entries errors are you getting? "No Results found!" or "No results due to database error." Also, have you tested out the query on it's own? I.e. hard coding a name into the query's WHERE filter to see if it returns results there? (using either a new, fresh page or something like phpmyadmin to test it) Quote Link to comment Share on other sites More sharing options...
stilllearning Posted May 25, 2010 Author Share Posted May 25, 2010 I get the "No results found!" Quote Link to comment Share on other sites More sharing options...
stilllearning Posted May 27, 2010 Author Share Posted May 27, 2010 Hi Bladescope Have you had time to look at this yet please? I have given it a try but am quite lost as PHP is not my strong point Thanks for your help so far! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.