----- Original Message ----- 
From: "whoisquilty" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Sunday, March 11, 2007 12:38 AM
Subject: [php-list] Re: Query not working...switched servers


James is right .... $prodvar is not set. I set it in a URL on the page
before. Which is how it
needs to happen, as it is set when the user clicks the link in a list of
choices. That link sets
the variable for the next page which brings up the results of the query I'm
having the
problems with.

In the code on the previous page, I said:

<a href="productions.php?prodvar='.$shows["showid"].'">

This has worked beautifully in the past on my previous two hosts. Is there a
better way?
-----------------------------
I write code for different servers all the time and I have learnt some rules
that prevent syntax and string parsing problems.

Some one may have a better 'style' but the following 'style' works for me -

Rules -
Always concatenate variable values and never expect them to parsed from a
string.
Alway use single quotes for keys especially for system variables such as
$_POST['mydata']
Always use double quotes for text strings unless the string contains double
quotes
Never place single quotes inside double quotes
Use only double quotes when escaping characters
Always use parenthesises for primitives like echo()

example -

echo('<a href="productions.php?prodvar=' . $shows['showid'] .
'">link</a><br>' . "\n");

Reply via email to