Re: [PHP] POST + QUERY

2007-03-28 Thread Dan Shirah

using mssql_fetch_assoc worked out great.  I had actually typed it in before
but the code formatting didn't change the color of the text like it normally
does for my mssql functions so I assumed it wasn't valid and deleted it.

Thanks to everyone for your help!


On 3/27/07, Jim Lucas <[EMAIL PROTECTED]> wrote:


Dan Shirah wrote:
> Okay, I thought this was VERY simple, but I cannot wrap my mind around
what
> I am doing wrong.
>
>
> echo $_POST['max_id'];  *The echo returns the correct result
> *if($_POST['max_id'] ='') {  *This is suppose to run the below query if
> $_POST['max_id'] is not blank*
>
> $max_id = $_POST['max_id'];  *Sets my POST value to a variable*
> $info = "SELECT * FROM payment_request WHERE id = '$max_id'"; *Selects
> record from my database by the matching ID's*
> $result_info = mssql_query($info) or die(mssql_error());  *Puts the
query
> results into a variable*
> $row_info = ifx_fetch_row($result_info);  *Makes a row in an array for
all
> the returned fields from my query*
>
> $my_info = $row_info['my_value'];
>
>  name="my_value">  *However, this box returns no data.*
>
> I should be using if($_POST['max_id'] ='') {   and
notif($_POST['max_id']
> !=='') { correct?  Since it is a comparative function just the =
should
> be correct.
>

Can someone take a look at this solution and tell me if this would be a
descent solution for his
problem?

I use this logic all over my code base, let me know if it is efficient,
clean, well structured, etc...

if ( isset($_POST['max_id']) ) {

   $max_id = (int)$_POST['max_id'];

   if ( empty($max_id) ) {
   die('not a valid id');
   # or some other, more graceful, way of catching the error
   }

   $SQL = "SELECT * FROM payment_request WHERE id = '{$max_id}'";

   if ( ( $result_info = mssql_query($SQL) ) === false ) {

   die(mssql_error());
   # again, maybe something more graceful here

   }

   if ( mssql_num_rows( $result_info ) == 0 ) {

   die('nothing to display');
   # again, maybe something more graceful here

   } else {

   while ( $row_info = mssql_fetch_array($result_info) ) {

   echo '';

   }

   }

}

--
Enjoy,

Jim Lucas

Different eyes see different things. Different hearts beat on different
strings. But there are times
for you and me when all such things agree.

- Rush






Re: [PHP] POST + QUERY

2007-03-27 Thread Jim Lucas

Dan Shirah wrote:

Okay, I thought this was VERY simple, but I cannot wrap my mind around what
I am doing wrong.


echo $_POST['max_id'];  *The echo returns the correct result
*if($_POST['max_id'] ='') {  *This is suppose to run the below query if
$_POST['max_id'] is not blank*

$max_id = $_POST['max_id'];  *Sets my POST value to a variable*
$info = "SELECT * FROM payment_request WHERE id = '$max_id'"; *Selects
record from my database by the matching ID's*
$result_info = mssql_query($info) or die(mssql_error());  *Puts the query
results into a variable*
$row_info = ifx_fetch_row($result_info);  *Makes a row in an array for all
the returned fields from my query*

$my_info = $row_info['my_value'];

  *However, this box returns no data.*

I should be using if($_POST['max_id'] ='') {   and notif($_POST['max_id']
!=='') { correct?  Since it is a comparative function just the = should
be correct.



Can someone take a look at this solution and tell me if this would be a descent solution for his 
problem?


I use this logic all over my code base, let me know if it is efficient, clean, 
well structured, etc...

if ( isset($_POST['max_id']) ) {

$max_id = (int)$_POST['max_id'];

if ( empty($max_id) ) {
die('not a valid id');
# or some other, more graceful, way of catching the error
}

$SQL = "SELECT * FROM payment_request WHERE id = '{$max_id}'";

if ( ( $result_info = mssql_query($SQL) ) === false ) {

die(mssql_error());
# again, maybe something more graceful here

}

if ( mssql_num_rows( $result_info ) == 0 ) {

die('nothing to display');
# again, maybe something more graceful here

} else {

while ( $row_info = mssql_fetch_array($result_info) ) {

echo '';

}

}

}

--
Enjoy,

Jim Lucas

Different eyes see different things. Different hearts beat on different strings. But there are times 
for you and me when all such things agree.


- Rush

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] POST + QUERY

2007-03-27 Thread Zoltán Németh
2007. 03. 27, kedd keltezéssel 17.28-kor Dan Shirah ezt írta:
> Here are the results of my print_r
> 
> Array ( [0] => 121 [1] => Y [2] => DS [3] =>  [4] => {03}
> [5] => 500 [6] => *** *[7] => John* [8] => Mark [9] => Doe [10] => 123 My
> Way [11] => 456 Your Place [12] => Smithville [13] => 12345 [14] => 5432
> [15] => 123555 [16] => 1235550011 [17] => [EMAIL PROTECTED] [18] => Y 
> [19] =>
> These are the comments [20] => Mar 27 2007 5:26PM [21] => Dan Create [22] =>
> Mar 27 2007 5:26PM [23] => Dan Research [24] => Mar 27 2007 5:26PM [25] =>
> Dan Submit [26] => C [27] => TN )
> 
> Bold and in red is the first_name column result.

yeah, this shows that you don't have an associative array, so you have
nothing like $row['fist_name']
you might access the fields by their number
or you could use mssql_fetch_assoc()
http://www.php.net/manual/en/function.mssql-fetch-assoc.php

greets
Zoltán Németh

> 
> On 3/27/07, Brad Bonkoski <[EMAIL PROTECTED]> wrote:
> >
> > Send us the output of print_r($row_info)
> > feel free to mask out any data values you may wish.
> >
> > Dan Shirah wrote:
> > > echo $row_info['first_name']; returns nothing.
> > >
> > > However I have verified the correct spelling both in the database and
> > > in the
> > > PHP code and they are identical and when I print_r it shows that there
> > > is a
> > > value in the first_name column of the record.
> > >
> > >
> > > On 3/27/07, Zoltán Németh <[EMAIL PROTECTED]> wrote:
> > >>
> > >> 2007. 03. 27, kedd keltezéssel 16.56-kor Dan Shirah ezt írta:
> > >> > Sorry, had a typo.
> > >> >
> > >> > *$cc_first = $row_info['first_name'];
> > >> > echo "$cc_first";*
> > >> >  this echo returns nothing.
> > >>
> > >> and what does
> > >> echo $row_info['first_name'];
> > >> print out?
> > >>
> > >> if still nothing, then probably
> > >> 1) you misspelled the field name and it's not called first_name
> > >> 2) the field first_name is empty in the row
> > >>
> > >> greets
> > >> Zoltán Németh
> > >>
> > >> >
> > >> > On 3/27/07, Dan Shirah <[EMAIL PROTECTED]> wrote:
> > >> > >
> > >> > > print_r($row_info) display the entire column contents of the
> > >> select id
> > >> > >
> > >> > > However,
> > >> > >
> > >> > > *$first = $row_info['first_name'];
> > >> > > echo "$cc_first";*
> > >> > >
> > >> > > the above echo still returns nothing.
> > >> > >
> > >> > >
> > >> > > On 3/27/07, Davi <[EMAIL PROTECTED]> wrote:
> > >> > > >
> > >> > > > Em Terça 27 Março 2007 17:40, Dan Shirah escreveu:
> > >> > > > > I have echoed something out after virtually every line of
> > >> code :)
> > >> > > > >
> > >> > > > > When I echo out my result ($result_info) it returns Resource
> > >> id#2
> > >> > > > > When I echo out my row ($row_info) it returns Array
> > >> > > > >
> > >> > > > > When I try to echo out a field from my array($my_info) it
> > >> returns
> > >> > > > nothing
> > >> > > > > at all.
> > >> > > > >
> > >> > > >
> > >> > > > How about:
> > >> > > >
> > >> > > > print_r($row_info);
> > >> > > >
> > >> > > > ??
> > >> > > >
> > >> > > >
> > >> > > > --
> > >> > > > Davi Vidal
> > >> > > > [EMAIL PROTECTED]
> > >> > > > [EMAIL PROTECTED]
> > >> > > > --
> > >> > > >
> > >> > > > Agora com fortune:
> > >> > > > " I want to be so bleeding edge that I cut myself!
> > >> > > >  agaffney, no, that's just emo
> > >> > > >  Gentoo is emo :P"
> > >> > > >
> > >> > > > --
> > >> > > > PHP General Mailing List (http://www.php.net/)
> > >> > > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >> > > >
> > >> > > >
> > >> > >
> > >>
> > >>
> > >
> >
> >

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] POST + QUERY

2007-03-27 Thread Davi

I would try an
echo $my_info[7];

[]s


Em Terça 27 Março 2007 18:28, Dan Shirah escreveu:
> Here are the results of my print_r
>
> Array ( [0] => 121 [1] => Y [2] => DS [3] =>  [4] => {03}
> [5] => 500 [6] => *** *[7] => John* [8] => Mark [9] => Doe [10] => 123 My
> Way [11] => 456 Your Place [12] => Smithville [13] => 12345 [14] => 5432
> [15] => 123555 [16] => 1235550011 [17] => [EMAIL PROTECTED] [18] => Y 
> [19] =>
> These are the comments [20] => Mar 27 2007 5:26PM [21] => Dan Create [22]
> => Mar 27 2007 5:26PM [23] => Dan Research [24] => Mar 27 2007 5:26PM [25]
> => Dan Submit [26] => C [27] => TN )
>
> Bold and in red is the first_name column result.
>
> On 3/27/07, Brad Bonkoski <[EMAIL PROTECTED]> wrote:
> > Send us the output of print_r($row_info)
> > feel free to mask out any data values you may wish.
> >
> > Dan Shirah wrote:
> > > echo $row_info['first_name']; returns nothing.
> > >
> > > However I have verified the correct spelling both in the database and
> > > in the
> > > PHP code and they are identical and when I print_r it shows that there
> > > is a
> > > value in the first_name column of the record.
> > >
> > > On 3/27/07, Zoltán Németh <[EMAIL PROTECTED]> wrote:
> > >> 2007. 03. 27, kedd keltezéssel 16.56-kor Dan Shirah ezt írta:
> > >> > Sorry, had a typo.
> > >> >
> > >> > *$cc_first = $row_info['first_name'];
> > >> > echo "$cc_first";*
> > >> >  this echo returns nothing.
> > >>
> > >> and what does
> > >> echo $row_info['first_name'];
> > >> print out?
> > >>
> > >> if still nothing, then probably
> > >> 1) you misspelled the field name and it's not called first_name
> > >> 2) the field first_name is empty in the row
> > >>
> > >> greets
> > >> Zoltán Németh
> > >>
> > >> > On 3/27/07, Dan Shirah <[EMAIL PROTECTED]> wrote:
> > >> > > print_r($row_info) display the entire column contents of the
> > >>
> > >> select id
> > >>
> > >> > > However,
> > >> > >
> > >> > > *$first = $row_info['first_name'];
> > >> > > echo "$cc_first";*
> > >> > >
> > >> > > the above echo still returns nothing.
> > >> > >
> > >> > > On 3/27/07, Davi <[EMAIL PROTECTED]> wrote:
> > >> > > > Em Terça 27 Março 2007 17:40, Dan Shirah escreveu:
> > >> > > > > I have echoed something out after virtually every line of
> > >>
> > >> code :)
> > >>
> > >> > > > > When I echo out my result ($result_info) it returns Resource
> > >>
> > >> id#2
> > >>
> > >> > > > > When I echo out my row ($row_info) it returns Array
> > >> > > > >
> > >> > > > > When I try to echo out a field from my array($my_info) it
> > >>
> > >> returns
> > >>
> > >> > > > nothing
> > >> > > >
> > >> > > > > at all.
> > >> > > >
> > >> > > > How about:
> > >> > > >
> > >> > > > print_r($row_info);
> > >> > > >
> > >> > > > ??
> > >> > > >
> > >> > > >
> > >> > > > --
> > >> > > > Davi Vidal
> > >> > > > [EMAIL PROTECTED]
> > >> > > > [EMAIL PROTECTED]
> > >> > > > --
> > >> > > >
> > >> > > > Agora com fortune:
> > >> > > > " I want to be so bleeding edge that I cut myself!
> > >> > > >  agaffney, no, that's just emo
> > >> > > >  Gentoo is emo :P"
> > >> > > >
> > >> > > > --
> > >> > > > PHP General Mailing List (http://www.php.net/)
> > >> > > > To unsubscribe, visit: http://www.php.net/unsub.php

-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--

Agora com fortune:
"Unless hours were cups of sack, and minutes capons, and clocks the tongues
of bawds, and dials the signs of leaping houses, and the blessed sun himself
a fair, hot wench in flame-colored taffeta, I see no reason why thou shouldst
be so superfluous to demand the time of the day.  I wasted time and now doth
time waste me.
-- William Shakespeare"

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] POST + QUERY

2007-03-27 Thread Brad Bonkoski

Dan Shirah wrote:

Here are the results of my print_r
 
Array ( [0] => 121 [1] => Y [2] => DS [3] =>  [4] => 
{03} [5] => 500 [6] => *** *[7] => John* [8] => Mark [9] => Doe [10] 
=> 123 My Way [11] => 456 Your Place [12] => Smithville [13] => 12345 
[14] => 5432 [15] => 123555 [16] => 1235550011 [17] => [EMAIL PROTECTED] 
 [18] => Y [19] => These are the comments [20] => Mar 
27 2007 5:26PM [21] => Dan Create [22] => Mar 27 2007 5:26PM [23] => 
Dan Research [24] => Mar 27 2007 5:26PM [25] => Dan Submit [26] => C 
[27] => TN )
 
Bold and in red is the first_name column result.

use the numeric reference then...
[..] is the index into the array, so if you want "John" use $row_info[7]

and if you *want* to use the name or associative array
read here:
http://www.php.net/manual/en/function.mssql-fetch-array.php

-B
 
On 3/27/07, *Brad Bonkoski* <[EMAIL PROTECTED] 
> wrote:


Send us the output of print_r($row_info)
feel free to mask out any data values you may wish.

Dan Shirah wrote:
> echo $row_info['first_name']; returns nothing.
>
> However I have verified the correct spelling both in the
database and
> in the
> PHP code and they are identical and when I print_r it shows that
there
> is a
> value in the first_name column of the record.
>
>
> On 3/27/07, Zoltán Németh <[EMAIL PROTECTED]
> wrote:
>>
>> 2007. 03. 27, kedd keltezéssel 16.56-kor Dan Shirah ezt írta:
>> > Sorry, had a typo.
>> >
>> > *$cc_first = $row_info['first_name'];
>> > echo "$cc_first";*
>> >  this echo returns nothing.
>>
>> and what does
>> echo $row_info['first_name'];
>> print out?
>>
>> if still nothing, then probably
>> 1) you misspelled the field name and it's not called first_name
>> 2) the field first_name is empty in the row
>>
>> greets
>> Zoltán Németh
>>
>> >
>> > On 3/27/07, Dan Shirah < [EMAIL PROTECTED]
> wrote:
>> > >
>> > > print_r($row_info) display the entire column contents of the
>> select id
>> > >
>> > > However,
>> > >
>> > > *$first = $row_info['first_name'];
>> > > echo "$cc_first";*
>> > >
>> > > the above echo still returns nothing.
>> > >
>> > >
>> > > On 3/27/07, Davi <[EMAIL PROTECTED]
> wrote:
>> > > >
>> > > > Em Terça 27 Março 2007 17:40, Dan Shirah escreveu:
>> > > > > I have echoed something out after virtually every line of
>> code :)
>> > > > >
>> > > > > When I echo out my result ($result_info) it returns
Resource
>> id#2
>> > > > > When I echo out my row ($row_info) it returns Array
>> > > > >
>> > > > > When I try to echo out a field from my array($my_info) it
>> returns
>> > > > nothing
>> > > > > at all.
>> > > > >
>> > > >
>> > > > How about:
>> > > >
>> > > > print_r($row_info);
>> > > >
>> > > > ??
>> > > >
>> > > >
>> > > > --
>> > > > Davi Vidal
>> > > > [EMAIL PROTECTED]

>> > > > [EMAIL PROTECTED] 
>> > > > --
>> > > >
>> > > > Agora com fortune:
>> > > > " I want to be so bleeding edge that I cut myself!
>> > > >  agaffney, no, that's just emo
>> > > >  Gentoo is emo :P"
>> > > >
>> > > > --
>> > > > PHP General Mailing List (http://www.php.net/
)
>> > > > To unsubscribe, visit: http://www.php.net/unsub.php
>> > > >
>> > > >
>> > >
>>
>>
>




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] POST + QUERY

2007-03-27 Thread Dan Shirah

Here is the result from the   Once again, bold and red is the
first_name field.


array(28) {
 [0]=>
 int(122)
 [1]=>
 string(1) "Y"
 [2]=>
 string(2) "DS"
 [3]=>
 string(16) ""
 [4]=>
 string(4) "{03}"
 [5]=>
 float(500)
 [6]=>
 string(4) "*** "
 *[7]=>
 string(4) "John"*
 [8]=>
 string(4) "Mark"
 [9]=>
 string(3) "Doe"
 [10]=>
 string(40) "123 My Way  "
 [11]=>
 string(40) "456 Your Place  "
 [12]=>
 string(40) "Smithville  "
 [13]=>
 string(5) "12345"
 [14]=>
 string(4) "5432"
 [15]=>
 string(10) "123555"
 [16]=>
 string(10) "1235550011"
 [17]=>
 string(7) "[EMAIL PROTECTED]"
 [18]=>
 string(1) "Y"
 [19]=>
 string(22) "These are the comments"
 [20]=>
 string(19) "Mar 27 2007  5:29PM"
 [21]=>
 string(30) "Dan Create"
 [22]=>
 string(19) "Mar 27 2007  5:29PM"
 [23]=>
 string(30) "Dan Research  "
 [24]=>
 string(19) "Mar 27 2007  5:29PM"
 [25]=>
 string(30) "Dan Submit"
 [26]=>
 string(1) "C"
 [27]=>
 string(2) "TN"
}




On 3/27/07, Zoltán Németh <[EMAIL PROTECTED]> wrote:


2007. 03. 27, kedd keltezéssel 17.17-kor Dan Shirah ezt írta:
> echo $row_info['first_name']; returns nothing.
>
> However I have verified the correct spelling both in the database and
> in the PHP code and they are identical and when I print_r it shows
> that there is a value in the first_name column of the record.

maybe paste here the complete result of:

echo "";
var_dump($row_info);
echo "";

so I might have some more ideas...

greets
Zoltán Németh

>
> On 3/27/07, Zoltán Németh <[EMAIL PROTECTED]> wrote:
> 2007. 03. 27, kedd keltezéssel 16.56-kor Dan Shirah ezt írta:
> > Sorry, had a typo.
> >
> > *$cc_first = $row_info['first_name'];
> > echo "$cc_first";*
> >  this echo returns nothing.
>
> and what does
> echo $row_info['first_name'];
> print out?
>
> if still nothing, then probably
> 1) you misspelled the field name and it's not called
> first_name
> 2) the field first_name is empty in the row
>
> greets
> Zoltán Németh
>
> >
> > On 3/27/07, Dan Shirah <[EMAIL PROTECTED]> wrote:
> > >
> > > print_r($row_info) display the entire column contents of
> the select id
> > >
> > > However,
> > >
> > > *$first = $row_info['first_name'];
> > > echo "$cc_first";*
> > >
> > > the above echo still returns nothing.
> > >
> > >
> > > On 3/27/07, Davi <[EMAIL PROTECTED]> wrote:
> > > >
> > > > Em Terça 27 Março 2007 17:40, Dan Shirah escreveu:
> > > > > I have echoed something out after virtually every line
> of code :)
> > > > >
> > > > > When I echo out my result ($result_info) it returns
> Resource id#2
> > > > > When I echo out my row ($row_info) it returns Array
> > > > >
> > > > > When I try to echo out a field from my array($my_info)
> it returns
> > > > nothing
> > > > > at all.
> > > > >
> > > >
> > > > How about:
> > > >
> > > > print_r($row_info);
> > > >
> > > > ??
> > > >
> > > >
> > > > --
> > > > Davi Vidal
> > > > [EMAIL PROTECTED]
> > > > [EMAIL PROTECTED]
> > > > --
> > > >
> > > > Agora com fortune:
> > > > " I want to be so bleeding edge that I cut
> myself!
> > > >  agaffney, no, that's just emo
> > > >  Gentoo is emo :P"
> > > >
> > > > --
> > > > PHP General Mailing List (http://www.php.net/)
> > > > To unsubscribe, visit: http://www.php.net/unsub.php
> > > >
> > > >
> > >
>
>




Re: [PHP] POST + QUERY

2007-03-27 Thread Dan Shirah

Here are the results of my print_r

Array ( [0] => 121 [1] => Y [2] => DS [3] =>  [4] => {03}
[5] => 500 [6] => *** *[7] => John* [8] => Mark [9] => Doe [10] => 123 My
Way [11] => 456 Your Place [12] => Smithville [13] => 12345 [14] => 5432
[15] => 123555 [16] => 1235550011 [17] => [EMAIL PROTECTED] [18] => Y [19] 
=>
These are the comments [20] => Mar 27 2007 5:26PM [21] => Dan Create [22] =>
Mar 27 2007 5:26PM [23] => Dan Research [24] => Mar 27 2007 5:26PM [25] =>
Dan Submit [26] => C [27] => TN )

Bold and in red is the first_name column result.

On 3/27/07, Brad Bonkoski <[EMAIL PROTECTED]> wrote:


Send us the output of print_r($row_info)
feel free to mask out any data values you may wish.

Dan Shirah wrote:
> echo $row_info['first_name']; returns nothing.
>
> However I have verified the correct spelling both in the database and
> in the
> PHP code and they are identical and when I print_r it shows that there
> is a
> value in the first_name column of the record.
>
>
> On 3/27/07, Zoltán Németh <[EMAIL PROTECTED]> wrote:
>>
>> 2007. 03. 27, kedd keltezéssel 16.56-kor Dan Shirah ezt írta:
>> > Sorry, had a typo.
>> >
>> > *$cc_first = $row_info['first_name'];
>> > echo "$cc_first";*
>> >  this echo returns nothing.
>>
>> and what does
>> echo $row_info['first_name'];
>> print out?
>>
>> if still nothing, then probably
>> 1) you misspelled the field name and it's not called first_name
>> 2) the field first_name is empty in the row
>>
>> greets
>> Zoltán Németh
>>
>> >
>> > On 3/27/07, Dan Shirah <[EMAIL PROTECTED]> wrote:
>> > >
>> > > print_r($row_info) display the entire column contents of the
>> select id
>> > >
>> > > However,
>> > >
>> > > *$first = $row_info['first_name'];
>> > > echo "$cc_first";*
>> > >
>> > > the above echo still returns nothing.
>> > >
>> > >
>> > > On 3/27/07, Davi <[EMAIL PROTECTED]> wrote:
>> > > >
>> > > > Em Terça 27 Março 2007 17:40, Dan Shirah escreveu:
>> > > > > I have echoed something out after virtually every line of
>> code :)
>> > > > >
>> > > > > When I echo out my result ($result_info) it returns Resource
>> id#2
>> > > > > When I echo out my row ($row_info) it returns Array
>> > > > >
>> > > > > When I try to echo out a field from my array($my_info) it
>> returns
>> > > > nothing
>> > > > > at all.
>> > > > >
>> > > >
>> > > > How about:
>> > > >
>> > > > print_r($row_info);
>> > > >
>> > > > ??
>> > > >
>> > > >
>> > > > --
>> > > > Davi Vidal
>> > > > [EMAIL PROTECTED]
>> > > > [EMAIL PROTECTED]
>> > > > --
>> > > >
>> > > > Agora com fortune:
>> > > > " I want to be so bleeding edge that I cut myself!
>> > > >  agaffney, no, that's just emo
>> > > >  Gentoo is emo :P"
>> > > >
>> > > > --
>> > > > PHP General Mailing List (http://www.php.net/)
>> > > > To unsubscribe, visit: http://www.php.net/unsub.php
>> > > >
>> > > >
>> > >
>>
>>
>




Re: [PHP] POST + QUERY

2007-03-27 Thread Zoltán Németh
2007. 03. 27, kedd keltezéssel 17.17-kor Dan Shirah ezt írta:
> echo $row_info['first_name']; returns nothing.  
>  
> However I have verified the correct spelling both in the database and
> in the PHP code and they are identical and when I print_r it shows
> that there is a value in the first_name column of the record.

maybe paste here the complete result of:

echo "";
var_dump($row_info);
echo "";

so I might have some more ideas...

greets
Zoltán Németh

>  
> On 3/27/07, Zoltán Németh <[EMAIL PROTECTED]> wrote: 
> 2007. 03. 27, kedd keltezéssel 16.56-kor Dan Shirah ezt írta:
> > Sorry, had a typo.
> >
> > *$cc_first = $row_info['first_name']; 
> > echo "$cc_first";*
> >  this echo returns nothing.
> 
> and what does
> echo $row_info['first_name'];
> print out?
> 
> if still nothing, then probably
> 1) you misspelled the field name and it's not called
> first_name 
> 2) the field first_name is empty in the row
> 
> greets
> Zoltán Németh
> 
> >
> > On 3/27/07, Dan Shirah <[EMAIL PROTECTED]> wrote:
> > >
> > > print_r($row_info) display the entire column contents of
> the select id 
> > >
> > > However,
> > >
> > > *$first = $row_info['first_name'];
> > > echo "$cc_first";*
> > >
> > > the above echo still returns nothing.
> > > 
> > >
> > > On 3/27/07, Davi <[EMAIL PROTECTED]> wrote:
> > > >
> > > > Em Terça 27 Março 2007 17:40, Dan Shirah escreveu:
> > > > > I have echoed something out after virtually every line
> of code :) 
> > > > >
> > > > > When I echo out my result ($result_info) it returns
> Resource id#2
> > > > > When I echo out my row ($row_info) it returns Array
> > > > >
> > > > > When I try to echo out a field from my array($my_info)
> it returns 
> > > > nothing
> > > > > at all.
> > > > >
> > > >
> > > > How about:
> > > >
> > > > print_r($row_info);
> > > >
> > > > ?? 
> > > >
> > > >
> > > > --
> > > > Davi Vidal
> > > > [EMAIL PROTECTED]
> > > > [EMAIL PROTECTED]
> > > > --
> > > >
> > > > Agora com fortune:
> > > > " I want to be so bleeding edge that I cut
> myself!
> > > >  agaffney, no, that's just emo 
> > > >  Gentoo is emo :P"
> > > >
> > > > --
> > > > PHP General Mailing List (http://www.php.net/)
> > > > To unsubscribe, visit: http://www.php.net/unsub.php
> > > >
> > > >
> > >
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] POST + QUERY

2007-03-27 Thread Davi

Have you tried use number instead name?

Something like:

echo $row_info[0];

On mysql, you've mysql_fetch_object... Does has anything like this on MS Sql 
Server?

best regards...

Em Terça 27 Março 2007 18:17, Dan Shirah escreveu:
> echo $row_info['first_name']; returns nothing.
>
> However I have verified the correct spelling both in the database and in
> the PHP code and they are identical and when I print_r it shows that there
> is a value in the first_name column of the record.
>
> On 3/27/07, Zoltán Németh <[EMAIL PROTECTED]> wrote:
> > 2007. 03. 27, kedd keltezéssel 16.56-kor Dan Shirah ezt írta:
> > > Sorry, had a typo.
> > >
> > > *$cc_first = $row_info['first_name'];
> > > echo "$cc_first";*
> > >  this echo returns nothing.
> >
> > and what does
> > echo $row_info['first_name'];
> > print out?
> >
> > if still nothing, then probably
> > 1) you misspelled the field name and it's not called first_name
> > 2) the field first_name is empty in the row
> >
> > greets
> > Zoltán Németh
> >
> > > On 3/27/07, Dan Shirah <[EMAIL PROTECTED]> wrote:
> > > > print_r($row_info) display the entire column contents of the select
> > > > id
> > > >
> > > > However,
> > > >
> > > > *$first = $row_info['first_name'];
> > > > echo "$cc_first";*
> > > >
> > > > the above echo still returns nothing.
> > > >
> > > > On 3/27/07, Davi <[EMAIL PROTECTED]> wrote:
> > > > > Em Terça 27 Março 2007 17:40, Dan Shirah escreveu:
> > > > > > I have echoed something out after virtually every line of code :)
> > > > > >
> > > > > > When I echo out my result ($result_info) it returns Resource id#2
> > > > > > When I echo out my row ($row_info) it returns Array
> > > > > >
> > > > > > When I try to echo out a field from my array($my_info) it returns
> > > > >
> > > > > nothing
> > > > >
> > > > > > at all.
> > > > >
> > > > > How about:
> > > > >
> > > > > print_r($row_info);
> > > > >
> > > > > ??
> > > > >
> > > > >
> > > > > --
> > > > > Davi Vidal
> > > > > [EMAIL PROTECTED]
> > > > > [EMAIL PROTECTED]
> > > > > --
> > > > >
> > > > > Agora com fortune:
> > > > > " I want to be so bleeding edge that I cut myself!
> > > > >  agaffney, no, that's just emo
> > > > >  Gentoo is emo :P"
> > > > >
> > > > > --
> > > > > PHP General Mailing List (http://www.php.net/)
> > > > > To unsubscribe, visit: http://www.php.net/unsub.php

-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--

Agora com fortune:
"[during a fishing trip] 
Peter Griffin:  Man, some trip this turned out to be. All we caught is a tire, 
a boot, a tin can and this book of clich�s."

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] POST + QUERY

2007-03-27 Thread Brad Bonkoski

Send us the output of print_r($row_info)
feel free to mask out any data values you may wish.

Dan Shirah wrote:

echo $row_info['first_name']; returns nothing.

However I have verified the correct spelling both in the database and 
in the
PHP code and they are identical and when I print_r it shows that there 
is a

value in the first_name column of the record.


On 3/27/07, Zoltán Németh <[EMAIL PROTECTED]> wrote:


2007. 03. 27, kedd keltezéssel 16.56-kor Dan Shirah ezt írta:
> Sorry, had a typo.
>
> *$cc_first = $row_info['first_name'];
> echo "$cc_first";*
>  this echo returns nothing.

and what does
echo $row_info['first_name'];
print out?

if still nothing, then probably
1) you misspelled the field name and it's not called first_name
2) the field first_name is empty in the row

greets
Zoltán Németh

>
> On 3/27/07, Dan Shirah <[EMAIL PROTECTED]> wrote:
> >
> > print_r($row_info) display the entire column contents of the 
select id

> >
> > However,
> >
> > *$first = $row_info['first_name'];
> > echo "$cc_first";*
> >
> > the above echo still returns nothing.
> >
> >
> > On 3/27/07, Davi <[EMAIL PROTECTED]> wrote:
> > >
> > > Em Terça 27 Março 2007 17:40, Dan Shirah escreveu:
> > > > I have echoed something out after virtually every line of 
code :)

> > > >
> > > > When I echo out my result ($result_info) it returns Resource 
id#2

> > > > When I echo out my row ($row_info) it returns Array
> > > >
> > > > When I try to echo out a field from my array($my_info) it 
returns

> > > nothing
> > > > at all.
> > > >
> > >
> > > How about:
> > >
> > > print_r($row_info);
> > >
> > > ??
> > >
> > >
> > > --
> > > Davi Vidal
> > > [EMAIL PROTECTED]
> > > [EMAIL PROTECTED]
> > > --
> > >
> > > Agora com fortune:
> > > " I want to be so bleeding edge that I cut myself!
> > >  agaffney, no, that's just emo
> > >  Gentoo is emo :P"
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
> >






--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] POST + QUERY

2007-03-27 Thread Dan Shirah

echo $row_info['first_name']; returns nothing.

However I have verified the correct spelling both in the database and in the
PHP code and they are identical and when I print_r it shows that there is a
value in the first_name column of the record.


On 3/27/07, Zoltán Németh <[EMAIL PROTECTED]> wrote:


2007. 03. 27, kedd keltezéssel 16.56-kor Dan Shirah ezt írta:
> Sorry, had a typo.
>
> *$cc_first = $row_info['first_name'];
> echo "$cc_first";*
>  this echo returns nothing.

and what does
echo $row_info['first_name'];
print out?

if still nothing, then probably
1) you misspelled the field name and it's not called first_name
2) the field first_name is empty in the row

greets
Zoltán Németh

>
> On 3/27/07, Dan Shirah <[EMAIL PROTECTED]> wrote:
> >
> > print_r($row_info) display the entire column contents of the select id
> >
> > However,
> >
> > *$first = $row_info['first_name'];
> > echo "$cc_first";*
> >
> > the above echo still returns nothing.
> >
> >
> > On 3/27/07, Davi <[EMAIL PROTECTED]> wrote:
> > >
> > > Em Terça 27 Março 2007 17:40, Dan Shirah escreveu:
> > > > I have echoed something out after virtually every line of code :)
> > > >
> > > > When I echo out my result ($result_info) it returns Resource id#2
> > > > When I echo out my row ($row_info) it returns Array
> > > >
> > > > When I try to echo out a field from my array($my_info) it returns
> > > nothing
> > > > at all.
> > > >
> > >
> > > How about:
> > >
> > > print_r($row_info);
> > >
> > > ??
> > >
> > >
> > > --
> > > Davi Vidal
> > > [EMAIL PROTECTED]
> > > [EMAIL PROTECTED]
> > > --
> > >
> > > Agora com fortune:
> > > " I want to be so bleeding edge that I cut myself!
> > >  agaffney, no, that's just emo
> > >  Gentoo is emo :P"
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
> >




Re: [PHP] POST + QUERY

2007-03-27 Thread Zoltán Németh
2007. 03. 27, kedd keltezéssel 16.56-kor Dan Shirah ezt írta:
> Sorry, had a typo.
> 
> *$cc_first = $row_info['first_name'];
> echo "$cc_first";*
>  this echo returns nothing.

and what does
echo $row_info['first_name'];
print out?

if still nothing, then probably
1) you misspelled the field name and it's not called first_name
2) the field first_name is empty in the row

greets
Zoltán Németh

> 
> On 3/27/07, Dan Shirah <[EMAIL PROTECTED]> wrote:
> >
> > print_r($row_info) display the entire column contents of the select id
> >
> > However,
> >
> > *$first = $row_info['first_name'];
> > echo "$cc_first";*
> >
> > the above echo still returns nothing.
> >
> >
> > On 3/27/07, Davi <[EMAIL PROTECTED]> wrote:
> > >
> > > Em Terça 27 Março 2007 17:40, Dan Shirah escreveu:
> > > > I have echoed something out after virtually every line of code :)
> > > >
> > > > When I echo out my result ($result_info) it returns Resource id#2
> > > > When I echo out my row ($row_info) it returns Array
> > > >
> > > > When I try to echo out a field from my array($my_info) it returns
> > > nothing
> > > > at all.
> > > >
> > >
> > > How about:
> > >
> > > print_r($row_info);
> > >
> > > ??
> > >
> > >
> > > --
> > > Davi Vidal
> > > [EMAIL PROTECTED]
> > > [EMAIL PROTECTED]
> > > --
> > >
> > > Agora com fortune:
> > > " I want to be so bleeding edge that I cut myself!
> > >  agaffney, no, that's just emo
> > >  Gentoo is emo :P"
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
> >

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] POST + QUERY

2007-03-27 Thread Zoltán Németh
2007. 03. 27, kedd keltezéssel 16.56-kor Dan Shirah ezt írta:
> print_r($row_info) display the entire column contents of the select id
> 
> However,
> 
> *$first = $row_info['first_name'];
> echo "$cc_first";*
> 
> the above echo still returns nothing.

yeah because you assign that value to $first, not to $cc_first what you
echo out later...

greets
Zoltán Németh

> 
> 
> On 3/27/07, Davi <[EMAIL PROTECTED]> wrote:
> >
> > Em Terça 27 Março 2007 17:40, Dan Shirah escreveu:
> > > I have echoed something out after virtually every line of code :)
> > >
> > > When I echo out my result ($result_info) it returns Resource id#2
> > > When I echo out my row ($row_info) it returns Array
> > >
> > > When I try to echo out a field from my array($my_info) it returns
> > nothing
> > > at all.
> > >
> >
> > How about:
> >
> > print_r($row_info);
> >
> > ??
> >
> >
> > --
> > Davi Vidal
> > [EMAIL PROTECTED]
> > [EMAIL PROTECTED]
> > --
> >
> > Agora com fortune:
> > " I want to be so bleeding edge that I cut myself!
> >  agaffney, no, that's just emo
> >  Gentoo is emo :P"
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] POST + QUERY

2007-03-27 Thread Dan Shirah

Sorry, had a typo.

*$cc_first = $row_info['first_name'];
echo "$cc_first";*
this echo returns nothing.

On 3/27/07, Dan Shirah <[EMAIL PROTECTED]> wrote:


print_r($row_info) display the entire column contents of the select id

However,

*$first = $row_info['first_name'];
echo "$cc_first";*

the above echo still returns nothing.


On 3/27/07, Davi <[EMAIL PROTECTED]> wrote:
>
> Em Terça 27 Março 2007 17:40, Dan Shirah escreveu:
> > I have echoed something out after virtually every line of code :)
> >
> > When I echo out my result ($result_info) it returns Resource id#2
> > When I echo out my row ($row_info) it returns Array
> >
> > When I try to echo out a field from my array($my_info) it returns
> nothing
> > at all.
> >
>
> How about:
>
> print_r($row_info);
>
> ??
>
>
> --
> Davi Vidal
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
> --
>
> Agora com fortune:
> " I want to be so bleeding edge that I cut myself!
>  agaffney, no, that's just emo
>  Gentoo is emo :P"
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



Re: [PHP] POST + QUERY

2007-03-27 Thread Dan Shirah

print_r($row_info) display the entire column contents of the select id

However,

*$first = $row_info['first_name'];
echo "$cc_first";*

the above echo still returns nothing.


On 3/27/07, Davi <[EMAIL PROTECTED]> wrote:


Em Terça 27 Março 2007 17:40, Dan Shirah escreveu:
> I have echoed something out after virtually every line of code :)
>
> When I echo out my result ($result_info) it returns Resource id#2
> When I echo out my row ($row_info) it returns Array
>
> When I try to echo out a field from my array($my_info) it returns
nothing
> at all.
>

How about:

print_r($row_info);

??


--
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--

Agora com fortune:
" I want to be so bleeding edge that I cut myself!
 agaffney, no, that's just emo
 Gentoo is emo :P"

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] POST + QUERY

2007-03-27 Thread Davi
Em Terça 27 Março 2007 17:40, Dan Shirah escreveu:
> I have echoed something out after virtually every line of code :)
>
> When I echo out my result ($result_info) it returns Resource id#2
> When I echo out my row ($row_info) it returns Array
>
> When I try to echo out a field from my array($my_info) it returns nothing
> at all.
>

How about:

print_r($row_info);

??


-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--

Agora com fortune:
" I want to be so bleeding edge that I cut myself!
 agaffney, no, that's just emo
 Gentoo is emo :P"

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] POST + QUERY

2007-03-27 Thread Brad Bonkoski

Echo $info where you hold you query, to make sure that is reasonable.

$result_info is the result set.
$row_info ...well you can use var_dump() on this to get its contents...

but if row_info prints out nothing, then there is probably a problem 
with the query, or your query is returning nothing..



Dan Shirah wrote:

I have echoed something out after virtually every line of code :)
 
When I echo out my result ($result_info) it returns Resource id#2

When I echo out my row ($row_info) it returns Array
 
When I try to echo out a field from my array($my_info) it returns 
nothing at all.


 
On 3/27/07, *Brad Bonkoski* <[EMAIL PROTECTED] 
> wrote:


Dan Shirah wrote:
> Should I use something besides mssql_fetch_row to get my result?  No
> matter
> which method I use for determining if the value exists, I still
get no
> data
> populated to my form.
Why not echo out your query before executing it, so you can run it
against the back end if you have it, or at least for a sanity
check to
make sure you are running the correct query.

>
> On 3/27/07, Tijnema ! <[EMAIL PROTECTED]
> wrote:
>>
>> On 3/27/07, Davi < [EMAIL PROTECTED]
> wrote:
>> > Em Terça 27 Março 2007 17:02, Dave Goodchild escreveu:
>> > > use: $_POST['max_id'] ==
>> > >
>> > > or even better:
>> > >
>> > > if (empty($_POST['max_id']))
>> >
>> > Why not:
>> >
>> > if (!(isset($_POST["max_id")))
>> >
>> > ?
>>
>> If form is left empty, it is set, but it's stil empty. So if you
>> submit a form the normal way, then it should pass this, even if you
>> leave it empty :)
>>
>> Tijnema
>> >
>> > --
>> > Davi Vidal
>> > [EMAIL PROTECTED] 
>> > [EMAIL PROTECTED] 
>> > --
>> >
>> > Agora com fortune:
>> > "Around computers it is difficult to find the correct unit of
time to
>> > measure progress.  Some cathedrals took a century to
complete.  Can
>> you
>> > imagine the grandeur and scope of a program that would take
as long?
>> >-- Epigrams in Programming, ACM SIGPLAN Sept.
1982"
>> >
>> > --
>> > PHP General Mailing List (http://www.php.net/)
>> > To unsubscribe, visit: http://www.php.net/unsub.php
>> >
>> >
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php

>>
>>
>




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] POST + QUERY

2007-03-27 Thread Dan Shirah

I have echoed something out after virtually every line of code :)

When I echo out my result ($result_info) it returns Resource id#2
When I echo out my row ($row_info) it returns Array

When I try to echo out a field from my array($my_info) it returns nothing at
all.


On 3/27/07, Brad Bonkoski <[EMAIL PROTECTED]> wrote:


Dan Shirah wrote:
> Should I use something besides mssql_fetch_row to get my result?  No
> matter
> which method I use for determining if the value exists, I still get no
> data
> populated to my form.
Why not echo out your query before executing it, so you can run it
against the back end if you have it, or at least for a sanity check to
make sure you are running the correct query.

>
> On 3/27/07, Tijnema ! <[EMAIL PROTECTED]> wrote:
>>
>> On 3/27/07, Davi <[EMAIL PROTECTED]> wrote:
>> > Em Terça 27 Março 2007 17:02, Dave Goodchild escreveu:
>> > > use: $_POST['max_id'] ==
>> > >
>> > > or even better:
>> > >
>> > > if (empty($_POST['max_id']))
>> >
>> > Why not:
>> >
>> > if (!(isset($_POST["max_id")))
>> >
>> > ?
>>
>> If form is left empty, it is set, but it's stil empty. So if you
>> submit a form the normal way, then it should pass this, even if you
>> leave it empty :)
>>
>> Tijnema
>> >
>> > --
>> > Davi Vidal
>> > [EMAIL PROTECTED]
>> > [EMAIL PROTECTED]
>> > --
>> >
>> > Agora com fortune:
>> > "Around computers it is difficult to find the correct unit of time to
>> > measure progress.  Some cathedrals took a century to complete.  Can
>> you
>> > imagine the grandeur and scope of a program that would take as long?
>> >-- Epigrams in Programming, ACM SIGPLAN Sept. 1982"
>> >
>> > --
>> > PHP General Mailing List (http://www.php.net/)
>> > To unsubscribe, visit: http://www.php.net/unsub.php
>> >
>> >
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>




Re: [PHP] POST + QUERY

2007-03-27 Thread Brad Bonkoski

Dan Shirah wrote:
Should I use something besides mssql_fetch_row to get my result?  No 
matter
which method I use for determining if the value exists, I still get no 
data

populated to my form.
Why not echo out your query before executing it, so you can run it 
against the back end if you have it, or at least for a sanity check to 
make sure you are running the correct query.




On 3/27/07, Tijnema ! <[EMAIL PROTECTED]> wrote:


On 3/27/07, Davi <[EMAIL PROTECTED]> wrote:
> Em Terça 27 Março 2007 17:02, Dave Goodchild escreveu:
> > use: $_POST['max_id'] ==
> >
> > or even better:
> >
> > if (empty($_POST['max_id']))
>
> Why not:
>
> if (!(isset($_POST["max_id")))
>
> ?

If form is left empty, it is set, but it's stil empty. So if you
submit a form the normal way, then it should pass this, even if you
leave it empty :)

Tijnema
>
> --
> Davi Vidal
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
> --
>
> Agora com fortune:
> "Around computers it is difficult to find the correct unit of time to
> measure progress.  Some cathedrals took a century to complete.  Can 
you

> imagine the grandeur and scope of a program that would take as long?
>-- Epigrams in Programming, ACM SIGPLAN Sept. 1982"
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php






--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] POST + QUERY

2007-03-27 Thread Zoltán Németh
2007. 03. 27, kedd keltezéssel 15.58-kor Dan Shirah ezt írta:
> Okay, I thought this was VERY simple, but I cannot wrap my mind around what
> I am doing wrong.
> 
> 
> echo $_POST['max_id'];  *The echo returns the correct result
> *if($_POST['max_id'] ='') {  *This is suppose to run the below query if
> $_POST['max_id'] is not blank*

with that line you assign a value to $_POST['max_id']
if you want to see that $_POST['max_id'] is not blank, you should use
if ($_POST['max_id'] != '') {

greets
Zoltán Németh

> 
> $max_id = $_POST['max_id'];  *Sets my POST value to a variable*
> $info = "SELECT * FROM payment_request WHERE id = '$max_id'"; *Selects
> record from my database by the matching ID's*
> $result_info = mssql_query($info) or die(mssql_error());  *Puts the query
> results into a variable*
> $row_info = ifx_fetch_row($result_info);  *Makes a row in an array for all
> the returned fields from my query*
> 
> $my_info = $row_info['my_value'];
> 
>  name="my_value">  *However, this box returns no data.*
> 
> I should be using if($_POST['max_id'] ='') {   and notif($_POST['max_id']
> !=='') { correct?  Since it is a comparative function just the = should
> be correct.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] POST + QUERY

2007-03-27 Thread Dan Shirah

Should I use something besides mssql_fetch_row to get my result?  No matter
which method I use for determining if the value exists, I still get no data
populated to my form.

On 3/27/07, Tijnema ! <[EMAIL PROTECTED]> wrote:


On 3/27/07, Davi <[EMAIL PROTECTED]> wrote:
> Em Terça 27 Março 2007 17:02, Dave Goodchild escreveu:
> > use: $_POST['max_id'] ==
> >
> > or even better:
> >
> > if (empty($_POST['max_id']))
>
> Why not:
>
> if (!(isset($_POST["max_id")))
>
> ?

If form is left empty, it is set, but it's stil empty. So if you
submit a form the normal way, then it should pass this, even if you
leave it empty :)

Tijnema
>
> --
> Davi Vidal
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
> --
>
> Agora com fortune:
> "Around computers it is difficult to find the correct unit of time to
> measure progress.  Some cathedrals took a century to complete.  Can you
> imagine the grandeur and scope of a program that would take as long?
>-- Epigrams in Programming, ACM SIGPLAN Sept. 1982"
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] POST + QUERY

2007-03-27 Thread Tijnema !

On 3/27/07, Davi <[EMAIL PROTECTED]> wrote:

Em Terça 27 Março 2007 17:02, Dave Goodchild escreveu:
> use: $_POST['max_id'] ==
>
> or even better:
>
> if (empty($_POST['max_id']))

Why not:

if (!(isset($_POST["max_id")))

?


If form is left empty, it is set, but it's stil empty. So if you
submit a form the normal way, then it should pass this, even if you
leave it empty :)

Tijnema


--
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--

Agora com fortune:
"Around computers it is difficult to find the correct unit of time to
measure progress.  Some cathedrals took a century to complete.  Can you
imagine the grandeur and scope of a program that would take as long?
   -- Epigrams in Programming, ACM SIGPLAN Sept. 1982"

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] POST + QUERY

2007-03-27 Thread Brad Bonkoski

Davi wrote:

Em Terça 27 Março 2007 17:02, Dave Goodchild escreveu:
  

use: $_POST['max_id'] ==

or even better:

if (empty($_POST['max_id']))



Why not:

if (!(isset($_POST["max_id")))

?

  

I think the poster *needs* the value to be set to something...
so if (isset(...)) {} would work
or if they expect the id to be numeric..
if( is_numeric(..)) {} would be even better.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] POST + QUERY

2007-03-27 Thread Dave Goodchild

Because isset will return true if the variable is set, even if it is blank.
Empty will return true is the variable holds an empty string.


Re: [PHP] POST + QUERY

2007-03-27 Thread Dan Shirah

  So I was dancing all around it by trying !== and =   but did not try
!=  /???  UGH!

On 3/27/07, Tijnema ! <[EMAIL PROTECTED]> wrote:


On 3/27/07, Dan Shirah <[EMAIL PROTECTED]> wrote:
> Okay, I thought this was VERY simple, but I cannot wrap my mind around
what
> I am doing wrong.
>
>
> echo $_POST['max_id'];  *The echo returns the correct result
> *if($_POST['max_id'] ='') {  *This is suppose to run the below query if
> $_POST['max_id'] is not blank*
>
> $max_id = $_POST['max_id'];  *Sets my POST value to a variable*
> $info = "SELECT * FROM payment_request WHERE id = '$max_id'"; *Selects
> record from my database by the matching ID's*
> $result_info = mssql_query($info) or die(mssql_error());  *Puts the
query
> results into a variable*
> $row_info = ifx_fetch_row($result_info);  *Makes a row in an array for
all
> the returned fields from my query*
>
> $my_info = $row_info['my_value'];
>
>  name="my_value">  *However, this box returns no data.*
>
> I should be using if($_POST['max_id'] ='') {   and
notif($_POST['max_id']
> !=='') { correct?  Since it is a comparative function just the =
should
> be correct

You're wrong, = means you want to give the variable on the left the
value on the right.
This if you're using now will always return true (atleast if you don't
have very buggy server). And your $_POST['max_id'] will; have the
value ''

Use != :)

Tijnema
>



Re: [PHP] POST + QUERY

2007-03-27 Thread Davi
Em Terça 27 Março 2007 17:02, Dave Goodchild escreveu:
> use: $_POST['max_id'] ==
>
> or even better:
>
> if (empty($_POST['max_id']))

Why not:

if (!(isset($_POST["max_id")))

?

-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--

Agora com fortune:
"Around computers it is difficult to find the correct unit of time to
measure progress.  Some cathedrals took a century to complete.  Can you
imagine the grandeur and scope of a program that would take as long?
-- Epigrams in Programming, ACM SIGPLAN Sept. 1982"

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] POST + QUERY

2007-03-27 Thread Brad Bonkoski

Dan Shirah wrote:
Okay, I thought this was VERY simple, but I cannot wrap my mind around 
what

I am doing wrong.


echo $_POST['max_id'];  *The echo returns the correct result
*if($_POST['max_id'] ='') {  *This is suppose to run the below query if
$_POST['max_id'] is not blank*

$max_id = $_POST['max_id'];  *Sets my POST value to a variable*
$info = "SELECT * FROM payment_request WHERE id = '$max_id'"; *Selects
record from my database by the matching ID's*
$result_info = mssql_query($info) or die(mssql_error());  *Puts the query
results into a variable*
$row_info = ifx_fetch_row($result_info);  *Makes a row in an array for 
all

the returned fields from my query*

$my_info = $row_info['my_value'];

maxlength="16"

name="my_value">  *However, this box returns no data.*

I should be using if($_POST['max_id'] ='') {   and notif($_POST['max_id']
!=='') { correct?  Since it is a comparative function just the = 
should

be correct.


read this:
http://php.net/operators

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] POST + QUERY

2007-03-27 Thread Tijnema !

On 3/27/07, Dan Shirah <[EMAIL PROTECTED]> wrote:

Okay, I thought this was VERY simple, but I cannot wrap my mind around what
I am doing wrong.


echo $_POST['max_id'];  *The echo returns the correct result
*if($_POST['max_id'] ='') {  *This is suppose to run the below query if
$_POST['max_id'] is not blank*

$max_id = $_POST['max_id'];  *Sets my POST value to a variable*
$info = "SELECT * FROM payment_request WHERE id = '$max_id'"; *Selects
record from my database by the matching ID's*
$result_info = mssql_query($info) or die(mssql_error());  *Puts the query
results into a variable*
$row_info = ifx_fetch_row($result_info);  *Makes a row in an array for all
the returned fields from my query*

$my_info = $row_info['my_value'];

  *However, this box returns no data.*

I should be using if($_POST['max_id'] ='') {   and notif($_POST['max_id']
!=='') { correct?  Since it is a comparative function just the = should
be correct


You're wrong, = means you want to give the variable on the left the
value on the right.
This if you're using now will always return true (atleast if you don't
have very buggy server). And your $_POST['max_id'] will; have the
value ''

Use != :)

Tijnema




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] POST + QUERY

2007-03-27 Thread Davi
Em Terça 27 Março 2007 16:58, Dan Shirah escreveu:
> Okay, I thought this was VERY simple, but I cannot wrap my mind around what
> I am doing wrong.
>
>
> echo $_POST['max_id'];  *The echo returns the correct result
> *if($_POST['max_id'] ='') {  *This is suppose to run the below query if
> $_POST['max_id'] is not blank*
>
> $max_id = $_POST['max_id'];  *Sets my POST value to a variable*
> $info = "SELECT * FROM payment_request WHERE id = '$max_id'"; *Selects
> record from my database by the matching ID's*
> $result_info = mssql_query($info) or die(mssql_error());  *Puts the query
> results into a variable*
> $row_info = ifx_fetch_row($result_info);  *Makes a row in an array for all
> the returned fields from my query*
>
> $my_info = $row_info['my_value'];
>
>  name="my_value">  *However, this box returns no data.*
>
> I should be using if($_POST['max_id'] ='') {   and notif($_POST['max_id']
> !=='') { correct?  Since it is a comparative function just the = should
> be correct.

= is a attribuitation...
== is comparative... =]

BTW, try an:
print_r($my_info);

[]s

-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--

Agora com fortune:
"A Duke must always take control of his household, for if he does not
rule those closest to him, he cannot hope to govern a planet.

  -- DUKE PAULUS ATREIDES"

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] POST + QUERY

2007-03-27 Thread Dave Goodchild

use: $_POST['max_id'] ==

or even better:

if (empty($_POST['max_id']))