[Gllug] mySQL PHP

Jackson, Harry HJackson at colt-telecom.com
Wed Jul 11 10:18:06 UTC 2001


> -----Original Message-----
> From: brichardson at lineone.net [mailto:brichardson at lineone.net]
> 
> This line is the problem?  Well, what you need to do is set the $varN
> variables to some default value if they are unset or FALSE.  Here's an
> example:
> 
> 	$var1 = $var1 ? $var1 : "default value";
> 
> or alternatively
> 
> 	($var1) || ($var1 = "default value);
> 
> whichever takes your fancy.
> 
> Or you could test to see if the variables have been set and 
> only execute
> your statement if they all are:
> 
> 	($var1) && ($var2) && ($var3) && ($var4) && ($var5)
> 	&& (execute your statement within these brackets);
> 
> Which would be more appropriate to your needs?  Setting 
> defaults or not
> executing if unset?

I know that I need to initialise them on entry but how do I get PHP to
ignore the initial values when Submit pressed. When I try to initialise them
with defaults they then always stick with these and they also print to the
screen.

> I have some other concerns about your code but there's no need to go
> down those byways right now.

	No do not hold back, I think that this may be accepted as a tool we
could use so any concerns you have will be well received. If it is about
accessing the database as localhost then I am aware that I need to be
accessing the database with a restricted user to avoid someone writing a
script to truncate the tables.


Please keep it simple I have only just been using mySQL and PHP for 5 days
and am no Wizard.

Harry.




 


**********************************************************************
COLT Telecommunications
Registered in England No. 2452736
Registered Office: Bishopsgate Court, 4 Norton Folgate, London E1 6DQ
Tel. 020 7390 3900

This message is subject to and does not create or vary any contractual
relationship between COLT Telecommunications, its subsidiaries or 
affiliates ("COLT") and you. Internet communications are not secure
and therefore COLT does not accept legal responsibility for the
contents of this message.  Any view or opinions expressed are those of
the author. The message is intended for the addressee only and its
contents and any attached files are strictly confidential. If you have
received it in error, please telephone the number above. Thank you.


**********************************************************************

-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list