FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Hmm..why doesnt this work?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Hmm..why doesnt this work? [message #176075 is a reply to message #176074] Tue, 22 November 2011 16:19 Go to previous messageGo to previous message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma:
Senior Member
The Natural Philosopher wrote:
>
>
> $old=(mysql_fetch_assoc(mysql_query(sprintf(
> "select login_name from employees where id='%d'",
> $_POST['id']))))['id'];
>
>
> Bitching about unexpected '['
>
> But mysql_fetch_assoc() returns an array so what's wrong with
>
> mysql_fetch_assoc()['id'];
>
> ??
cos this DOES work...

$oldarr=(mysql_fetch_assoc(mysql_query(sprintf("select login_name from
employees where id='%d'",$_POST['id']))));

$old=$oldarr['id'];

This is like using crap C compilers back in the 80's...
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to get client mac address in PHP ..?
Next Topic: Thumbnails with PHP
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat May 17 20:48:19 GMT 2025

Total time taken to generate the page: 0.04298 seconds