|
|
 |
Re: FN-FORUM PHP and MySQL...... Again
date posted 12th September 2002 22:37
This is a multi-part message in MIME format.
------=_NextPart_000_009E_01C25AAC.7CE2FA80
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
It's this line here...
$row[location] ."E-Mail:". $row[price]. "";
Although it is valid to supply a bareword (i.e. a string but without the =
quoted) as the subscript for an associative array, PHP will complain =
about it at certain error levels.
You can either change it to...
$row['location'] ."E-Mail:". $row['price']. "";
...or raise the error reporting level using (cunningly enough) the =
error_reporting() function.
Regards,
Steve
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D
Steve Webster
Freelance Web Developer
[EMAIL REMOVED]
PHP, MySQL, Flash, Perl + more
http://www.codejunkie.co.uk
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D
----- Original Message -----=20
From: Darren - Javelin Designs=20
To: [EMAIL REMOVED]
Sent: Thursday, September 12, 2002 10:01 PM
Subject: FN-FORUM PHP and MySQL...... Again
Hey, could some one have a look at the below code and tell me why it =
is bringing back all this crap:-
=20
Notice: Use of undefined constant location - assumed 'location' in =
C:wwwrootppshowprops.php on line 26
Notice: Use of undefined constant price - assumed 'price' in =
C:wwwrootppshowprops.php on line 26
Name:test
E-Mail:643848
Notice: Use of undefined constant location - assumed 'location' in =
C:wwwrootppshowprops.php on line 26
Notice: Use of undefined constant price - assumed 'price' in =
C:wwwrootppshowprops.php on line 26
Name:location
E-Mail:price
=20
include("vars.php");
mysql_connect ("$db_host", "$db_username", "$db_password") or =
die("Unable to connect to database");
@mysql_select_db("$db_name") or die("Unable to select database =
$db_name");
$sqlquery =3D "SELECT * FROM properties";
$result =3D mysql_query($sqlquery);
=20
while($row =3D mysql_fetch_array($result)) {
echo "Name:".
$row[location] ."E-Mail:". $row[price]. "";
}
=20
if(mysql_num_rows($result)
[EMAIL REMOVED] {
font-family: SimSun;
}
@font-face {
font-family: @SimSun;
}
@page Section1 {size: 595.3pt 841.9pt; margin: 72.0pt 90.0pt 72.0pt =
90.0pt; mso-header-margin: 35.4pt; mso-footer-margin: 35.4pt; =
mso-paper-source: 0; }
P.MsoNormal {
FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; =
mso-style-parent: ""; mso-pagination: widow-orphan; =
mso-fareast-font-family: SimSun
}
LI.MsoNormal {
FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; =
mso-style-parent: ""; mso-pagination: widow-orphan; =
mso-fareast-font-family: SimSun
}
DIV.MsoNormal {
FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; =
mso-style-parent: ""; mso-pagination: widow-orphan; =
mso-fareast-font-family: SimSun
}
A:link {
COLOR: blue; TEXT-DECORATION: underline; text-underline: single
}
SPAN.MsoHyperlink {
COLOR: blue; TEXT-DECORATION: underline; text-underline: single
}
A:visited {
COLOR: purple; TEXT-DECORATION: underline; text-underline: single
}
SPAN.MsoHyperlinkFollowed {
COLOR: purple; TEXT-DECORATION: underline; text-underline: single
}
P {
FONT-SIZE: 12pt; MARGIN-LEFT: 0cm; MARGIN-RIGHT: 0cm; FONT-FAMILY: =
"Times New Roman"; mso-pagination: widow-orphan; =
mso-fareast-font-family: SimSun; mso-margin-top-alt: auto; =
mso-margin-bottom-alt: auto
}
SPAN.EmailStyle18 {
COLOR: windowtext; FONT-FAMILY: Arial; mso-style-type: personal; =
mso-style-noshow: yes; mso-ansi-font-size: 10.0pt; mso-bidi-font-size: =
10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; =
mso-bidi-font-family: Arial
}
SPAN.EmailStyle19 {
COLOR: navy; FONT-FAMILY: Arial; mso-style-type: personal-reply; =
mso-style-noshow: yes; mso-ansi-font-size: 10.0pt; mso-bidi-font-size: =
10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; =
mso-bidi-font-family: Arial
}
DIV.Section1 {
page: Section1
}
It's this line here...
$row[location]=20
."<br><b>E-Mail:</b>". $row[price].=20
"</p>";
Although it is valid to =
supply a=20
bareword (i.e. a string but without the quoted) as the subscript for an=20
associative array, PHP will complain about it at certain error=20
levels.
You can either change it=20
to...
$row['location']=20
."<br><b>E-Mail:</b>". $row['price'].=20
"</p>";
...or raise the error =
reporting=20
level using (cunningly enough) the error_reporting() =
function.
Regards,
Steve
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D Steve Webster Freelance=20
Web Developer |
 |
|