| 
 Posted by Jerry Stuckle on 10/10/07 02:49 
Terry wrote: 
> Hi folks. 
> I am just starting to dabble in php. 
>  
> I am trying to do some simple pagination in php/mysql. 
>  
> For whatever reason I am only getting the first digit of my result. 
>  
> For example: 
>  
>   $result = mysql_query("select lamp_no from lamps as l where id=20"); 
>   $row = mysql_fetch_array($result); 
>   echo "20 = " . $row[0]['l'] 
>  
> only displays 1 it should have displayed 15 for me. 
>  
> Thanks, 
> Terry 
>  
 
Yep.  $row[0] is a string, containing the value of lamp_no.  $row[0][1]  
is a character in that string. 
 
--  
================== 
Remove the "x" from my email address 
Jerry Stuckle 
JDS Computer Training Corp. 
jstucklex@attglobal.net 
==================
 
  
Navigation:
[Reply to this message] 
 |