[PHP-DB] Searching a file for text surrounded by brackets

2003-07-16 Thread Jamie Saunders
Hi, I need a way of searching a file for text between two brackets, below
is an example of a couple of lines from the file I'm searching:

trtdfont size=2{L_LOGIN}/font/td/tr
trtdfont size=2{L_LOGOUT}/font/td/tr

So I'll need to search the above for text between the '{' and '}' brackets
and read each into an array.

-- 
Jamie Saunders
Media Architect
[EMAIL PROTECTED]



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] detecting browser close or change of url

2003-07-02 Thread Jamie Saunders
Hi,

I'm trying to figure out a way of detecting when a user closes the browser,
or if they leave the site.  If they do this I'd like to change a value in
the database, i.e:

if (browser is closed by user or they leave site)
{
 // run php code to update database
}

Any help much appreciated.

-- 
Jamie Saunders
Media Architect
[EMAIL PROTECTED]



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] detecting browser close or change of url

2003-07-02 Thread Jamie Saunders
Ok, let's explain the situation more fully:

Basically I have a session controlled login system for users to my site. If
they manually log-out, close the browser or move away from the site the
variables that are needed for them to view the 'members area' are unset,
hence they are logged out.  What I want to do is disable people logging
into the same user account at the same time.  Therefore when they log in I
set a value in the database to say the user account is locked.  If they
manually log out then this value is again changed to unlock the account.
However, if they close the browser or leave the site I can't figure out a
way to change the value in the database to unlock the account.

Any suggestions?

 PHP is server-side, not client side.
 That said, what you could do is simply make use of window.onunload or
 window.onclose in javascript to bring up a second window/page..
 of course, anyone with half a brain and a popup-stopper won't get that
 page :)

 --rylin


 Jamie Saunders wrote:

Hi,

I'm trying to figure out a way of detecting when a user closes the
browser, or if they leave the site.  If they do this I'd like to change
a value in the database, i.e:

if (browser is closed by user or they leave site)
{
 // run php code to update database
}

Any help much appreciated.




-- 
Jamie Saunders
Media Architect
[EMAIL PROTECTED]



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] checking a string for numbers

2003-06-26 Thread Jamie Saunders
Hi,

I'm trying to find a way of simply checking a string for numbers.

e.g.

if ($myVar contains a number)
{
 //numbers present
}
else
{
 //no numbers present
}

Thanks,

-- 
Jamie Saunders
Media Architect
[EMAIL PROTECTED]



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] strange query problem

2003-06-23 Thread Jamie Saunders
Hi,

I'm having a problem with a database query, where the script is simply
inserting some data into an empty table. The following code creates the
query string to be used, the values are all gathered from an html form:

$query = INSERT INTO $lcstage (id, .$fieldNames.) VALUES
(.$clientID.,.$values.);

The finishing querystring, if printed lookks like this:

INSERT INTO myfamily (id, fathers, mothers, brothers, sisters,
grandfathers, grandmothers, ggrandfathers, ggrandmothers, aunts, uncles,
godparents) VALUES
(36,'1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1')

However, I get a database error every time informing me the query could not
be performed.  To test the query I've pasted the printed query string into
phpMyAdmin and it works first time every time.  So if there's nothing wrong
with the query string or the database, what else could be causing this
error?

-- 
Jamie Saunders
Media Architect
[EMAIL PROTECTED]



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] new memeber

2003-06-11 Thread Jamie Saunders
Hi all,

I'm a new member to this mailing list and I thought I'd introduce myself.
Well, that's not completely true, I've been a member of this list in the
past under a different address, but that was at least a year ago.

Anyway, I'm a 'media architect' based in Warrington in the UK.I'm 20
years old and I've been coding in PHP for a few years now. I've just
started a new job which involves a vast amount of PHP programming, so I
thought it a good move to subscribe to this list.  I also hope I can help
others with problems. I specialise in dynamic, database driven sites and
think that PHP is one of the most versatile and user friendly programming
languages available.

Best Regards,

J


-- 
Jamie Saunders
Media Architect
[EMAIL PROTECTED]



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] mysql_fetch_array missing first record

2001-08-07 Thread Jamie Saunders

This was indeed the problem, I was calling the mysql_fetch_array earlier in
the code.
Once removed it worked fine.

Thanks.

Jamie

Paul Burney [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 on 8/7/01 1:41 PM, Jamie ([EMAIL PROTECTED]) wrote:

  while ($previews = mysql_fetch_array($result) {
code to display record here...
  }
 
  For some reason it refuses to display the very first record in the
table.
  Why is this and how can I get round it?

 Are you calling mysql_fetch_array before this in your code, perhaps to see
 if there is a result?  If so, that's the problem.  Each call to
 mysql_fetch_array (mysql_fetch_row) increments the array pointer.

 If that isn't your problem, please post more of the code so that we can
make
 a better diagnosis.

 Sincerely,

 Paul Burney

 +-+-+
 | Paul Burney | P: 310.825.8365 |
 | Webmaster  Programmer | E: [EMAIL PROTECTED]   |
 | UCLA - GSEIS - ETU   | W: http://www.gseis.ucla.edu/ |
 +-+-+




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]