RE: [PHP-DB] PHP&MySQL left/substring etc problem

2005-04-18 Thread Juffermans, Jos
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

Re: [PHP-DB] PHP&MySQL left/substring etc problem

2005-04-18 Thread Andrés G . Montañez
> 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

[PHP-DB] PHP&MySQL left/substring etc problem

2005-04-18 Thread Sugimoto
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 (

RE: [PHP-DB] PHP and MySql question

2005-04-18 Thread ReClMaples
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);

[PHP-DB] Re: php and tables

2005-04-18 Thread Frank M Flynn
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

RE: [PHP-DB] Parsing PHP sourced from blob

2005-04-18 Thread Bastien Koert
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,

[PHP-DB] Parsing PHP sourced from blob

2005-04-18 Thread boclair
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

SV: [PHP-DB] PHP and MySql question

2005-04-18 Thread Henrik Hornemann
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

[PHP-DB] parsing PHP from blob varaibles

2005-04-18 Thread [EMAIL PROTECTED]
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