Thread: SQLite
View Single Post
  #47  
Old 04-15-2009, 03:44 AM
devilsknite1 devilsknite1 is offline
C:
devilsknite1's Avatar
Join Date: Jul 2006
Location: Florida, USA
Posts: 269
devilsknite1 has a spectacular aura about
Send a message via AIM to devilsknite1 Send a message via MSN to devilsknite1 Send a message via Yahoo to devilsknite1
Would using this in an onPlayerLogin() still work? I tried Stefan's sample age code thing, and I get the working output, but if i try to edit it the slightest bit and use findPlayer( p.account ); (p is a param in the onPlayerLogin() function) I get this:
NPC Code:
Accounts in database: 0



Here's what I'm using:

PHP Code:
function onPlayerLogin)
{
  
findPlayerplayer.account );
  
requestsql("CREATE TABLE IF NOT EXISTS test (account varchar not null default '' primary key, id int not null default 1)"false);
  
requestsql("INSERT INTO test VALUES (" p.account "," p.id ")"false);
  
temp.req requestsql("SELECT * FROM test"true);
  if (!
temp.req.completed)
    
waitfor(temp.req,"onReceiveData",60);
  echo(
"Accounts in database: " temp.req.rows.size());
  for (
temp.rowtemp.req.rows)
    echo(
"  Account: " temp.row.account ", ID: " temp.row.id);  

Like I said, editing the code SLIGHTLY just gives me an output of 0. I didn't go through the whole SQLite language either, which I plan on doing later tomorrow.
Reply With Quote