|
Posted by kirke on 11/30/06 21:41
Thx. it works.
However what i want to get is
$result=11,12,13
not $result=111213
How can I put comma between numbers?
Peter van Schie wrote:
> Hi kirke,
>
> > $result= mssql_query($sql) or die();
> >
> > while ($row = mssql_fetch_array($result))
> > {
> > $veh = $veh+","+$row[0]; }
> >
> > But it doesn't work.....
> > Help me...
> > thx.
>
> Just use mssql_fetch_assoc instead of mssql_fetch_array, to only
> retrieve the associative array.
> Then you can use $row['A'] for instance to show the value of the current
> row's A value:
>
> $result= mssql_query($sql) or die();
>
> while ($row = mssql_fetch_assoc($result))
> {
> echo $row['A'] . '<br />';
> }
>
> Also note that you should check the input value of the formfield L,
> instead of just using it in the sql query. You should use
> mysql_real_escape_string to escape the value, like:
> mysql_real_escape_string($_POST['L'])
>
> Peter.
>
> --
> http://www.phpforums.nl
Navigation:
[Reply to this message]
|