| 
	
 | 
 Posted by Dodger on 07/05/06 11:08 
Rik wrote: 
> Dodger wrote: 
 
> mysqli_stmt_fetch_assoc doesn't exist, mysqli_stmt_fetch does. 
 
http://us2.php.net/manual/en/function.mysqli-fetch-assoc.php 
Not stmt_fetch_assoc, just fetch_assoc... 
 
> $statement->bind_results($city); 
> while ($statement->fetch()) { 
>     $cities[] = $city; 
> } 
 
> Look at the example at 
> http://www.php.net/manual/en/function.mysqli-stmt-bind-result.php 
 
Thanks, but that's the problem... 
 
I can't use vars named $col1, $col2, etc. I need names -- preferably as 
keys in an associative array... I'm selecintg * -- there could be a 
number of reasons that table might have differing numbers of columns -- 
for instance if I am selecting which table touse dynamically, and my 
session tables consider different things important to hold in a SQL 
fast lookup table... consider if I have one site that's a subscription 
site and another that's a web stire. The subscription site might want 
to have 'SESSION_SUBSCRIBED' as a session variable, while the store 
might want to have 'SESSION_STORED_CCARD_REF' as a session variable, 
where neither would be useful to the other. This way as long as they 
both have an 'id' column, it's fine. 
 
I actually do this. I have one site where I plugged in (shuddering as I 
type this because the code is atrocious...) PostNuke with PnPHPBB forum 
system, but I hacked it so that I can share my own session system with 
the PostNuke one... there are five extra session variables, including 
SESSION_PN_UID, SESSION_PHPBB_UID, and so on that Perl drops into the 
environment, so that, for instance, a Perl script can check and popup 
if they have new IMs...
 
  
Navigation:
[Reply to this message] 
 |