Jump to content

$Row[2] doesn't work


Recommended Posts

$Row[2] doesn't work but if I use $Row["linkcat"] than it works fine.

Is there somewhere to activate in the php.ini file ?



// I got 9 fields to in the table tbl_link !  $Row[2] should give me a number.

$Verbinding = mysql_connect($db_host, $db_user, $db_passw);
$sql = "Select * from tbl_link where userid=1";	
$ResultShow = mysql_query($sql);	

while ($Row = mysql_fetch_assoc($ResultShow)){

    echo $Row[2];







Link to comment
Share on other sites

Oh yes indeed, I overlooked this one ! 


I do need to use $Row[index] system for a function I 'm working on so I can use the same function  for different perposes.


The example was just a little example.  I need only 1 row back in fact. 


So yes mysql_fetch_row works fine, thanks.

Link to comment
Share on other sites

The issue is you are requesting the value for the Array where the KEY is 2.  Because your array has strings for keys, you have errors.


print_r() or var_dump() are great functions to use on arrays and objects to help determine the existence of your desires.

Link to comment
Share on other sites

This thread is more than a year old.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.