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
https://forums.phpfreaks.com/topic/202790-delete-entries-from-db/
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.

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)

 

 

Archived

This topic is now archived and is closed to further replies.

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