RE: [PHP-WIN] PHP_SELF
| From: | Uttam | Date: | Mon, 14 Oct 2002 11:48:43 +0000 |
| Subject: | RE: [PHP-WIN] PHP_SELF | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-16362@lists.php.net to get a copy of this message | ||
i think u need to do this:
a) convert the mysql result to an array using some iteration function like
array_walk().
b) if u r using sessions, save the array as a session variable for
subsequent usage.
OR
if u need to pass it as hidden field, then u should use the serialize()
function to pass the value to the form and later use the unserialize()
function to get back the original array.
//sample
$result = mysql_query($qu2);
$num = mysql_num_rows($result);
//suppose u convert the $result to array $rows then
<INPUT TYPE='hidden' VALUE=serialize($rows) NAME='result'>
//and after posting the form use
$rows = unserialize($_POST['result'])
cheers!
-----Original Message-----
From: Blue Presley [mailto:blue928@carolina.rr.com]
Sent: Monday, October 14, 2002 03:12
To: php-windows@lists.php.net
Subject: Re: [PHP-WIN] PHP_SELF
your error is not with PHP_SELF, it's in your mysql query.. you don't
put a
semicolon at the end of your statement..
$qu2 ="SELECT * FROM test_tabel ;"; should be
$qu2 = "select * from test_table";
anytime you receive the error you got, it's most likely due to a problem
with your Query.
blue
At 08:17 AM 10/13/2002 +0100, you wrote:
>hi rodrigo
>
>i tried this a few months bak but it didn work wirh
>forms i alwayz got silly errors which i KNEW ver rong
>
>anyway i used $PHP_SELF with links
>
>what u can do is u can make a submit LINK n make it
>look like a button (if u preffer buttons :S) and pass
>ur variables thru
>
>but then there cud be security risks :S
>
>well i hope dis helps
>
>luck
>
>toby ....
>
> --- Rodrigo San Martin <rodrigo@stud.ntnu.no> wrote:
> > Hi
> >
> > Have a problem. Need to pass a multiple array
> > through a form using a
> > PHP_SELF.
> > I pass it whith a hidden variabel but i get an error
> > warning.
> >
> > "Warning: Supplied argument is not a valid MySQL
> > result resource in..."
> >
> > The code is:
> >
> > ;
> > $result = mysql_query($qu2);
> > $num = mysql_num_rows($result);
> >
> > i take out some info from test_table (there are some
> > questions in the table
> > that the user need to answer), the user does some
> > operation, clicks submit
> > and is supposed to be presented whith the next
> > question in the table. I pass
> > the variable like this:
> >
> > <INPUT TYPE='hidden' VALUE='$result' NAME='result'>
> >
> > But no way josey. I get that warning.
> >
> > Anybody got i nice solution please.
> >
> >
> >
> >
> >
> > ------------------------------------------
> > Rodrigo San Martin
> > Institutt for datateknologi og informatikk
> >
> > http://www.idi.ntnu.no/~rodrigo
> >
> >
> >
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>__________________________________________________
>Do You Yahoo!?
>Everything you'll ever need on one web page
>from News and Sport to Email and Music Charts
>http://uk.my.yahoo.com
>
>--
>PHP Windows Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php