![]() |
|
#1
|
|||
|
|||
How to use wildcards in a mysql_query("DELETE......specifically something like:
PHP Code:
In the script I would replace any ival which is skipped by the user with that wildcard character. ...so the user would effectively 'select' the row('s) to be deleted based on the cell values that they have specified . In my trials, if I use a real matching value, either right on the line or in an '$ival2', the statement works.. I have been trying things like: * , \* , [\*] , % , \% , [\%] and variants with NO sucess.... What the heck am I missing.... Incidentally the variables are: $t1 = "books"; $f1 = "refnum"; $f2 = "pgcol"; $f3 = "catnum"; ...and from the user through a form.html: $ival1 = $_POST['ival1']; $ival2 = $_POST['ival2']; $ival3 = $_POST['ival3']; |
|||
|
#2
|
||||
|
||||
Re: How to use wildcards in a mysql_query("DELETE...If $f2 is a 'don't care' value, then why even include it? As long as the $f1 and $f3 match, then theoretically, $f2 is wild.
Quote:
However, the wildcard IS the % symbol, but it is used with the LIKE keyword, but not with the =. Quote:
But for a real example, that uses a wildcard for the 2nd column, I came up with this: Code:
Code:
Code:
Oh, in case you may not know, the underscore is used to match any single character. They have basic examples at the link. __________________
Use the force...read the source!! WYCIWYG -- what you code is what you get! |
|
#3
|
|||
|
|||
Re: How to use wildcards in a mysql_query("DELETE...Very good! Thanks for taking the time. I'm not working on the command line but I can see how it can be handy for testing. Maybe I should think about going ahead and installing.
Quote:
Code:
Code:
PHP Code:
Thanks Again!, Howard++; |
Recent GIDBlog
Problems with the Navy (Chiefs) by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The