If you do "SELECT LEFT(loc1,3) FROM openart_table" the column name in $row
(Bis probably not "loc1". Try this: "SELECT LEFT(loc1,3) AS loc1 FROM
(Bopenart_table". Also, after the fetch you can do some debuggin thru this:
(B
(B"; print_r($row); print "";
(B?>
(B
(BThat prints out a list of al
> But when I tried, "select left (loc1,3) from openart_table where.."
Try without the space between 'left' and '(',
I mean... LEFT(loc1, 3)
where loc1 is the name of the column,
and 3 the characters you want to show.
--
Atte, Andrés G. Montañez
Técnico en Redes y Telecomunicaciones
Montevide
Hello,
(BI need your help about PHP (ver 4.3.1) and MySQL (ver 3.23) database.
(BI am struggling to customise a database (using left command etc), and am
(Bstuck now.
(BPlease have a brief look at my scripts below.
(B
(BWhat I do like to do is to get first 3 letters from "loc1" column from
(
Ok, I tried what you saidHere's the code:
$res = mysql_query(
"SELECT ZG_LATITUDE, ZG_LONGITUDE FROM zip_code where
zg_zipcode = '$zip'");
List($Lat,$Lon) = mysql_fetch_row($res);
$Lat1 = ($Lat-2);
$Lat2= ($Lat+2);
$Lon1= ($Lon-2);
$Lon2= ($Lon+2);
//echo ($Lat1);
//echo ($Lat2);
There are two places you can figure out the average: in MySQL or in
PHP. Then you want to sort the results by this Average: in MySql use
"ORDER BY" and in php use "array_multisort"
in MySQL your SQL might look like:
SELECT TEAM, PLAYED, WIN, LOSS, DRAW, POINTS, POINTS / PLAYED as
AVERAGE
try eval (http://ca3.php.net/manual/en/function.eval.php)
Bastien
From: boclair <[EMAIL PROTECTED]>
To: "php-db@lists.php.net"
Subject: [PHP-DB] Parsing PHP sourced from blob Date: Mon, 18 Apr 2005
17:52:52 +1000
When a php statement is "part" of a markup snippet in a mysql database
table field,
When a php statement is "part" of a markup snippet in a mysql database
table field, what must be done to have the php parse in the html
A simple demo demonstrating my problem is at
http://www.boclair.com/test/blobvars.php
Louise
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, vis
Hi,
Your problem is that your variables $Lat1,$Lat2,$Lon1,$Lon2 all reffer
to resultsets and not the Latitudes or Longitudes.
Try something like this:
$res = mysql_query(
"SELECT ZG_LATITUDE, ZG-LONGITUDE FROM zip_code where
zg_zipcode = '$zip'");
List($Lat,$Lon) = mysql_fetch_row($r
When a php statement is "part" of a markup snippet in a mysql database
table field, what must be done to have the php parse in the html document.
A simple demo demonstrating my problem is at
http://www.boclair.com/test/blobvars.php
Louise