Jump to content

Delete entries from DB


stilllearning

Recommended Posts

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]

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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)

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.