Do you have a question? Post it now! No Registration Necessary. Now with pictures!
March 13, 2006, 9:37 pm
rate this thread
I have some wierd MySQL queries. Although I am using ADODB (an
abstraction layer) - the queries will probably be quite general.
1) When I post data in a url (i.e. post.php?id=120) and I use this
code: $var = secure_field($id); it will work (on the
"recieve_page.php"). However if I use $secure_field($_POST['$id']) or
any POST/GET/REQUEST type option, it won't work. Its fine, because
secure_field does what I need, however I'm just not sure why its not
picking it up. (If I probe $var - the result is blank)
2) I have a table, where I want a delete button at the end of each row
(as opposed to when only one record is displayed on the screen). I also
don't want to have to post to an external delete.php file. Is there a
way to do this?
Where $id = $rs->fields
Even with hardcoded MySQL I have never been able to resolve this delete
per row problem. Any help would be great.
Re: General queries
Hmm. You mention ADODB, but the coding questions you are asking involve
PHP. Also, I don't see any MySQL question in your posting. Perhaps you
would get a more specific reply from a PHP newsgroup.
What is secure_field()? Is this a function of yours?
The expression $id is a variable. Passing the variable to the
secure_field() function substitutes the value of $id, not the string '$id'.
What is the value of $id? Presumably it contains the name of the request
parameter you're reading.
In PHP, putting '$id' in quotes prevents the variable from being expanded.
So the expression is trying to find an entry in the _POST parameter array
whose name is literally '$id', not the value of the $id variable as in the
other example above.
. . .
You could make the href='this_page.php?id=$id2;action=delete' and then look
for the 'action' parameter in your php script. If the value is delete, then
delete the specified entry. If the value of the action parameter is not
delete, then it defaults to edit.
- » Americanas.com SALDO de TVs Com at 80% de Desconto (29798)
- — Newest thread in » MySQL Database Forum