Forum Moderators: coopster

Message Too Old, No Replies

Notice: Undefined index:

         

rizwan

11:32 am on May 29, 2004 (gmt 0)

10+ Year Member



i write this php code
//*************************************************
<?php
require_once("Connections/connection.php");
$q_prod_prop = "select * from prop_prod";
$rs_q_prop_prod = mysql_query($q_prod_prop,$link) or die(mysql_error($link));

echo "Query :" .$q_prod_prop;
echo "<br>";
echo "<br>";
echo "Total No. of Records :".mysql_num_rows($rs_q_prop_prod);
echo "<BR>";

while($rows_rs_q_prop_prod = mysql_fetch_row($rs_q_prop_prod))
{
echo $rows_rs_q_prop_prod["prop_id"];
echo $rows_rs_q_prop_prod["prop_value"];
}

?>
//************************************************** *

But output of above php code is
//**************************************************

Query :select * from prop_prod

Total No. of Records :100

Notice: Undefined index: prop_id in c:\inetpub\wwwroot\sdsdynamic\testing.php on line 13

Notice: Undefined index: prop_value in c:\inetpub\wwwroot\sdsdynamic\testing.php on line 14

Notice: Undefined index: prop_id in c:\inetpub\wwwroot\sdsdynamic\testing.php on line 13

Notice: Undefined index: prop_value in c:\inetpub\wwwroot\sdsdynamic\testing.php on line 14

Notice: Undefined index: prop_id in c:\inetpub\wwwroot\sdsdynamic\testing.php on line 13

Notice: Undefined index: prop_value in c:\inetpub\wwwroot\sdsdynamic\testing.php on line 14

so on....
//************************************************** ****

why gives me Notice: Undefined index: prop_value in...
Plz help me thanx.... in adv..

Timotheos

2:42 pm on May 29, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You'll want to use mysql_fetch_assoc() [us4.php.net] (or maybe mysql_fetch_array() [us4.php.net]) rather then mysql_fetch_row().

venelin13

3:01 pm on May 29, 2004 (gmt 0)

10+ Year Member



Well, I have had the same problem before a few months, but using mysql_fetch_array() function. The client has installed this application at windows server. Once he moved to a Linux based server, the problem just gone.

You should use Windows server to host your web applications, only in case the application required some of the MS technologies. Otherwise, use Linux based server.

coopster

7:23 pm on May 29, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, rizwan!

Timotheos is correct, you are trying to use an associative index when it is not there by nature of the mysql_fetch_row() [php.net] function. That function only has enumerated indexes. Each result column is stored in an array offset, starting at offset 0.

Take his advice and try one of the other two functions :-)

rizwan

5:12 am on May 31, 2004 (gmt 0)

10+ Year Member



Thanx to all those help me
Realy Thanx...