|
|
 |
Re: FN-FORUM: PHP if null show this instead of that +
date posted 24th August 2007 14:10
damn I thought it was something to do with the query inside a query thing
>> print '
>> href=3D"http://confirm_details.php?details=3D$myrow7]">Update';
>
>> However the $myrow[7] isn't playing ball! I am guessing I need to put=
>
>> this in something like [] or "" to get it to acutally work?
>
> Yes, variable expansion doesn't happen in single-quoted strings. You'll =
> =
>
> need something like:
>
> echo "Updat=
> e";
> echo '
> href=3D"http://confirm_details.php?details=3D'.$myrow[7].'">Update';=
>
>
> or various other alternatives.
>
> FWIW you might find mysql_fetch_assoc() useful, so that your code can ha=
> ve =
>
> $myrow['column_name'] instead of $myrow[column_index] - makes for more =
>
> readable and maintainable code.
>
> Cheers!
>
> Anthony
> -- =
>
> www.fonant.com - Quality web sites
>
> --
> Freelancers, contractors earn more with Prosperity4
> Call 0870 870 4414 or visit www.prosperity4.com
> and benefit from Inland Revenue approved expenses today.
>
> To advertise here: http://www.freelancers.net/advertising.html
>
> |
 |
|