Search found 30 matches

by seriousdamage
Thu Jan 17, 2008 2:36 pm
Forum: PHP - Code
Topic: Select one or multiple records and then delete them
Replies: 9
Views: 728

Re: Select one or multiple records and then delete them

Hi, I must really apologize, but you just spoke a language that I have no idea what it means.
I keep looking at the code but I just don't get it.
I am sorry.
by seriousdamage
Thu Jan 17, 2008 1:56 pm
Forum: PHP - Code
Topic: Select one or multiple records and then delete them
Replies: 9
Views: 728

Re: Select one or multiple records and then delete them

OK, that surely did something right, now, the previous error is gone, and the delete button has appeared, but when I select a record and click on delete , first the page refreshes and shows all record in the database and at the bottom I get the error : Warning: Invalid argument supplied for foreach(...
by seriousdamage
Thu Jan 17, 2008 1:40 pm
Forum: PHP - Code
Topic: Select one or multiple records and then delete them
Replies: 9
Views: 728

Re: Select one or multiple records and then delete them

still not working, I get the following message:

Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in /usr/local/psa/home/vhosts/giustinianinicola.com/httpdocs/contacts/search.php on line 30
by seriousdamage
Thu Jan 17, 2008 11:52 am
Forum: PHP - Code
Topic: Select one or multiple records and then delete them
Replies: 9
Views: 728

Re: Select one or multiple records and then delete them

I have tried to apply this method but it does not work, and I can't find the problem.   while($row = mysql_fetch_array($result)) {     echo "<tr bgcolor=#4682b4>";   echo "<td><input type=\"checkbox\" name=\"delete[]\" value=\"$row[first_name]\" /></td>&q...
by seriousdamage
Thu Jan 17, 2008 10:29 am
Forum: PHP - Code
Topic: Select one or multiple records and then delete them
Replies: 9
Views: 728

Select one or multiple records and then delete them

Hi, I have a little database, I can search for records and display them in an html table, I would like to have a check box of every record returned by the search and a button that onclick will delete the selected records from the database. I am far away from having any idea on where to start on this...
by seriousdamage
Thu Jan 17, 2008 10:14 am
Forum: PHP - Code
Topic: Only geting exact match from database query
Replies: 2
Views: 182

Re: Only geting exact match from database query

cool, works great, thanks a lot.
by seriousdamage
Thu Jan 17, 2008 9:49 am
Forum: PHP - Code
Topic: Only geting exact match from database query
Replies: 2
Views: 182

Only geting exact match from database query

Hi, when I run the following query I only get the exact match of what I have searched for, I think I need to use % sign so that I can search for Nic and get also Nicola as a result. But I can figuer out where to add the % I use an external webform for the search. $result = mysql_query("SELECT *...
by seriousdamage
Thu Jan 17, 2008 9:37 am
Forum: PHP - Code
Topic: search query and results
Replies: 10
Views: 700

Re: search query and results

Hi, problem solved, I have written the code as follows, maybe this was the long way around, but for a biginner like me, it just does the job. $result = mysql_query("SELECT * FROM contacts where first_name LIKE '" . $_POST['search'] ."' OR last_name LIKE '" . $_POST['search'] .&qu...
by seriousdamage
Thu Jan 17, 2008 8:28 am
Forum: PHP - Code
Topic: search query and results
Replies: 10
Views: 700

Re: search query and results

But I still don't understand how can I allow a user on my website to search for info using a webform.
by seriousdamage
Thu Jan 17, 2008 4:08 am
Forum: PHP - Code
Topic: search query and results
Replies: 10
Views: 700

Re: search query and results

Hi, who could help me checking what is wrong with the below SQL statement? I am trying to tell the script to search the all databese for the string contained in the search field of the form called search.html. I just can't make it work. $result = mysql_query("SELECT * FROM contacts where ='&quo...
by seriousdamage
Wed Jan 16, 2008 1:27 pm
Forum: PHP - Code
Topic: search query and results
Replies: 10
Views: 700

Re: search query and results

then I am understanding this wrong,
how can I say that whatever I am asking to serch for, in the html form, it has to seach in the entire database, in all columns,
and then show the entire row?

Thanks
Nic
by seriousdamage
Wed Jan 16, 2008 11:49 am
Forum: PHP - Code
Topic: search query and results
Replies: 10
Views: 700

Re: search query and results

Hi,
I think it was a combination of both, but now I get a new error.

1054: Unknown column 'search' in 'where clause'

Any idea?

Thanks
Nic
by seriousdamage
Wed Jan 16, 2008 11:11 am
Forum: PHP - Code
Topic: search query and results
Replies: 10
Views: 700

search query and results

Hi, could someone look at the bebelow code and help me fixing the error message? I have a page with one text field to search and a php script to show the results. and I get the following error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /usr/local/psa/hom...
by seriousdamage
Mon Dec 24, 2007 7:03 am
Forum: PHP - Code
Topic: Search or select
Replies: 22
Views: 3166

Thanks, it workes great, I think I just need one more function to finish, this would be to modify a record within a form. I have added a new link called modify just like you showed me for delete, but what I am looking for is that when I click the record can become writsble so that I can change it an...
by seriousdamage
Mon Dec 24, 2007 5:47 am
Forum: PHP - Code
Topic: Search or select
Replies: 22
Views: 3166

Hi, it keeps returning "0 row delete succesfully"
and the record still in the database.