[PHP-DB] Sql with Sybase variables @@
Hi, Is the following possible: $conn = sybase_connect(SERVER,login,passwd); $sql = select @@version; $result = sybase_query($sql,$conn); while($row = sybase_query($result)) { $r = $row[0]; echo $r; } I tried but get a strange error message that I dont understand, what would be the correct syntax? Regards Richard Hillström -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] MySQL: Alphabetizing title results in library format
Petr Tuma wrote: What error message it produce? Ok, table titles is composed of: +--+-++ | titlesid | releaseyear | title | +--+-++ mysql select *,(case when title like 'The %' then substring (title, 5, 255) when title like 'A %' then substring (title, 3, 255) when title like 'An %' then substring (title, 4, 255) else title end) as sort_col from titles order by sort_col; ERROR 1064: You have an error in your SQL syntax near 'when title like 'The %' then substring (title, 5, 255) when title like 'A %' the' at line 1 -- Ian Evans Digital Hit Entertainment - News and Information http://www.digitalhit.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] MySQL: Alphabetizing title results in library format
Hi Ian, Try this: mysql select *,(case when title like '%The%' then substring (title, 5, 255) when title like '%A%' then substring (title, 3, 255) when title like '%An%' then substring (title, 4, 255) else title end) as sort_col from titles order by sort_col; Hope it helps, Cami -Original Message- From: Ian Evans [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 01, 2001 9:20 AM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] MySQL: Alphabetizing title results in library format Petr Tuma wrote: What error message it produce? Ok, table titles is composed of: +--+-++ | titlesid | releaseyear | title | +--+-++ mysql select *,(case when title like 'The %' then substring (title, 5, 255) when title like 'A %' then substring (title, 3, 255) when title like 'An %' then substring (title, 4, 255) else title end) as sort_col from titles order by sort_col; ERROR 1064: You have an error in your SQL syntax near 'when title like 'The %' then substring (title, 5, 255) when title like 'A %' the' at line 1 -- Ian Evans Digital Hit Entertainment - News and Information http://www.digitalhit.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] MySQL: Alphabetizing title results in library format
Cami wrote: Try this: mysql select *,(case when title like '%The%' then substring (title, 5, 255) when title like '%A%' then substring (title, 3, 255) when title like '%An%' then substring (title, 4, 255) else title end) as sort_col from titles order by sort_col; Argh, that still produces the same syntax error. Our hosting company is using MySQL 3.22.32 if that's any help. -- Ian Evans Digital Hit Entertainment - News and Information http://www.digitalhit.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] MySQL: Alphabetizing title results in library format
Have you tried it like this: mysql select case when title like '%The %' then substring (title, 5, 255) when title like '%A %' then substring (title, 3, 255) when title like '%An %' then substring (title, 4, 255) else title end as sort_col from titles order by sort_col; I can't tested, but that's what the manual say. Cami -Original Message- From: Ian Evans [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 01, 2001 9:20 AM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] MySQL: Alphabetizing title results in library format Petr Tuma wrote: What error message it produce? Ok, table titles is composed of: +--+-++ | titlesid | releaseyear | title | +--+-++ mysql select *,(case when title like 'The %' then substring (title, 5, 255) when title like 'A %' then substring (title, 3, 255) when title like 'An %' then substring (title, 4, 255) else title end) as sort_col from titles order by sort_col; ERROR 1064: You have an error in your SQL syntax near 'when title like 'The %' then substring (title, 5, 255) when title like 'A %' the' at line 1 -- Ian Evans Digital Hit Entertainment - News and Information http://www.digitalhit.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] PostgreSQL to MySQL
hi i have a .sql file that was dumped from PostgreSQL and i want to import that into MySQL. I haven't got a clue how i am gonna approach that. Can anyone suggest me a good starting point? maybe a script or something that can perform the action for me ??? ax -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Ms-Access to Mysql converter
can anyone tell me which is a good Ms-Access to MySQL converter under open source /demo /commercial/etc. -TIA Sharmad -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Ms-Access to Mysql converter
On Thu, 1 Nov 2001 16:17:38 +0550 [EMAIL PROTECTED] wrote: Most of them availalbe in the downloads section of mysql.com : http://www.mysql.com/downloads/contrib.html Look at the sections clients, converter and using MySql with Other Products hth pa -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Error: No such file or directory
Executing from a script file I continue to receive the following errors when compiling PHP4: System: SuSE 7.1, latest Apache PHP source ./myphpmakefile: --with-apache=/usr/local/src/apache/apache_1.3.22: No such file or directory ./myphpmakefile: --with-config-file-path=/www/conf: No such file or directory ./myphpmakefile: --with-apxs=/www/bin: No such file or directory ./myphpmakefile: --with-db3=/usr/local/BerkeleyDB.3.3: No such file or directory ./myphpmakefile: --enable-track-vars: command not found Looked at ld.so.conf as the problem but entry appears correct. Not making sense as to what is going on. Ideas? Thanks in advance. Greg -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] retrieve data from more db
Simply indicate the database name in you query: SELECT cust2000.mytable.*, cust2001.mystable.* FROM cust2000.mytable, cust2001.mystable WHERE cust2000.mytable.cust_ID=cust2001.mystable.cust_ID; -Original Message- From: Sommai Fongnamthip [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 31, 2001 11:37 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] retrieve data from more db HI, I have data on more than 1 db to separate in year name like these: cust2000-- contain customer infomation in year 2000 cust2001-- contain customer infomation in year 2001 all db have the same field name. I have put db name and table name in separate file (something like include.php). How I write php code to retrieve my interest value to display in one time? for more help pls describe how to layout compare table in the code. Thank you, SF -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Re: Error: No such file or directory
Hmm, Seems if I execute ./configure (with arguments) from termial (shell prompt) no error. But when executed from shell script there is an error. Does this make sense? Greg Robinson [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Executing from a script file I continue to receive the following errors when compiling PHP4: System: SuSE 7.1, latest Apache PHP source ./myphpmakefile: --with-apache=/usr/local/src/apache/apache_1.3.22: No such file or directory ./myphpmakefile: --with-config-file-path=/www/conf: No such file or directory ./myphpmakefile: --with-apxs=/www/bin: No such file or directory ./myphpmakefile: --with-db3=/usr/local/BerkeleyDB.3.3: No such file or directory ./myphpmakefile: --enable-track-vars: command not found Looked at ld.so.conf as the problem but entry appears correct. Not making sense as to what is going on. Ideas? Thanks in advance. Greg -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Re: Ordering titles in MySQL (long)
Hi Ian, I tried a couple different things, trying to chop off leading articles. I didn't want to maintain a 2nd column for titles, but eventually had to succumb to this. (My difficulty is that I'm using French and English titles (for a bilingual interface), so I actually have four fields: my fields are labelled as follows: nameE (english title), nameF (french title), namesortE (english title with leading article removed), namesortF (with french leading article removed. When I enter a title into my database, using a php form, the leading article is lopped off the front off the title and this new form of the title is thrown into the record's namesortE column. (the same thing happens for the french fields). Leading articles that I want to remove are stored in a text file called 'noisewords.txt' my script looks for words in the text file, and if it finds a match between the text file entries and the title I've just entered, it removes the appearance of the word, in the title. the 'varnameE' and 'varnameF' fields may throw you off. it is used as working title. our records go by more than one title so in order to view the records by title or by variant title (alphabetically skipping leading articles) I've had to have a separate table for titles just for the sake of holding variant names. please overlook my coding practices in the snippet below. I've had no formal training in programming, since my trs-80 days learning BASIC on 2K radio shack computers. be assured though, the following does work for me. I came up with this solution thanks to olinux who forwarded me the URL for this article: http://phpbuilder.com/columns/clay19990421.php3 which even includes a list of noisewords for you. Cameron (code below) *** following is the code I currently use: stage==1 is the process of data being entered into the database. stage==2 is the input form that supplies the data for stage==1. ?php if($stage == 1) { // PROCESS ADD NEW DATABASE RECORD FORM $connect = mysql_connect(localhost, $username, $password); $select = mysql_select_db(bases); // INSERT NEW DATA INTO PRINCIPLE TABLE while(list($key, $vala) = each ($accessID)) while(list($key, $valf) = each ($formatID)) while(list($key, $valu) = each ($urlID)) while(list($key, $valv) = each ($vendorID)) { $query = INSERT INTO principle (nameE, nameF, daterange, descriptionE, subjectE, notesE, descriptionF, subjectF, notesF, license, accessID, formatID, urlID, vendorID, orbispo, livedate) VALUES ('$nameE', '$nameF', '$daterange', '$descriptionE', '$subjectE', '$notesE', '$descriptionF', '$subjectF', '$notesF', '$license', '$vala', '$valf', '$valu', '$valv', '$orbispo', '$livedate'); $result = mysql_query($query) OR die($query . mysql_error()); } ? ?php // INSERT NEW DATA INTO SOFTWAREDETAILS TABLE while(list($key, $vals) = each ($softwareID)) { $query_2 = INSERT INTO softwaredetails (baseID, softwareID) VALUES ('$newbaseID', '$vals'); $result_2 = mysql_query($query_2) OR die($query . mysql_error()); } ? ?php // INSERT NEW DATA INTO VARNAME TABLE { $query_3 = INSERT INTO varname (varnameE, varnameF, baseID) VALUES ('$nameE', '$nameF', '$newbaseID'); $result_3 = mysql_query($query_3) OR die($query . mysql_error()); } ? ?php //TRIMSCRIPT FOR ENGLISH NAMESORT COLUMN IN TABLE PRINCIPLE $query = select nameE, baseID from principle; $result = mysql_query($query); $number = mysql_numrows($result); $j = 0; WHILE ($j $number) { $title = mysql_result($result,$j,nameE); $qid = mysql_result($result,$j,baseID); $noise_words = file (noisewords.txt); $filtered = $title; $filtered = ereg_replace(^, ,$filtered); for ($i=0; $i count($noise_words); $i++) { $filterword = trim($noise_words[$i]); $filtered = eregi_replace( $filterword , ,$filtered); } $filtered = trim($filtered); $filtered = addslashes($filtered); $querywords = ereg_replace(,,,$filtered); $entersorts = UPDATE principle set namesortE = \$querywords\ WHERE baseID = $qid; $result_0 = mysql_query($entersorts) OR die($entersorts . mysql_error()); $j++; } //E-STAT special case update ENGLISH $estate = UPDATE principle set namesortE = \E-STAT\ WHERE baseID = 73; $result_0 = mysql_query($estate) OR die($estate . mysql_error()); ? ?php //TRIMSCRIPT FOR FRENCH NAMESORT COLUMN IN TABLE PRINCIPLE $query = select nameF, baseID from principle; $result = mysql_query($query); $number = mysql_numrows($result); $j = 0; WHILE ($j $number) { $title = mysql_result($result,$j,nameF); $qid = mysql_result($result,$j,baseID); $noise_words = file (noisewords.txt); $filtered = $title; $filtered = ereg_replace(^, ,$filtered); for ($i=0; $i count($noise_words); $i++) { $filterword = trim($noise_words[$i]); $filtered = eregi_replace( $filterword , ,$filtered); } $filtered = trim($filtered); $filtered = addslashes($filtered); $querywords = ereg_replace(,,,$filtered); $entersorts = UPDATE principle set namesortF = \$querywords\ WHERE baseID = $qid; $result_0 =
[PHP-DB] php bulletin/dicussion board
Hi, can anyone recommend a good php discussion/bulletin board thats free, as I need to choose one and have been over whelmed by the variety available. Cheers Tom Hodder -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] php bulletin/dicussion board
http://phorum.org/ Russ On Thu, 1 Nov 2001 15:52:01 - Tom Hodder [EMAIL PROTECTED] wrote: Hi, can anyone recommend a good php discussion/bulletin board thats free, as I need to choose one and have been over whelmed by the variety available. Cheers Tom Hodder -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] #---# Believe nothing - consider everything Russ Michell Anglia Polytechnic University Webteam Room 1C 'The Eastings' East Road, Cambridge e: [EMAIL PROTECTED] w: www.apu.ac.uk/webteam www.theruss.com #---# -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Re: Error: No such file or directory
Ok, solution seems to be eliminating comments in the script. When comments are removed, script errors also disappear. Greg Robinson [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hmm, Seems if I execute ./configure (with arguments) from termial (shell prompt) no error. But when executed from shell script there is an error. Does this make sense? Greg Robinson [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Executing from a script file I continue to receive the following errors when compiling PHP4: System: SuSE 7.1, latest Apache PHP source ./myphpmakefile: --with-apache=/usr/local/src/apache/apache_1.3.22: No such file or directory ./myphpmakefile: --with-config-file-path=/www/conf: No such file or directory ./myphpmakefile: --with-apxs=/www/bin: No such file or directory ./myphpmakefile: --with-db3=/usr/local/BerkeleyDB.3.3: No such file or directory ./myphpmakefile: --enable-track-vars: command not found Looked at ld.so.conf as the problem but entry appears correct. Not making sense as to what is going on. Ideas? Thanks in advance. Greg -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] php bulletin/dicussion board
If you have mySQL phpBB is excellent http://www.phpbb.com/ HTH Paul - Original Message - From: Tom Hodder [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, November 01, 2001 3:52 PM Subject: [PHP-DB] php bulletin/dicussion board : : Hi, : : can anyone recommend a good php discussion/bulletin board thats free, as I : need to choose one and have been over whelmed by the variety available. : : Cheers : : Tom Hodder : : : -- : PHP Database Mailing List (http://www.php.net/) : To unsubscribe, e-mail: [EMAIL PROTECTED] : For additional commands, e-mail: [EMAIL PROTECTED] : To contact the list administrators, e-mail: [EMAIL PROTECTED] : -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Error: stub.lo file trunacted file not found
On SuSE 7.1 Latest PHP and Apache source using --with-apxs with PHP configure receive noted error. Anyone solve this? Saw thread in PHPbuilder about removing stub.c and remaking, that provided an error stating stub.c was required. Thanks Greg -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Question about MySQL, ORDER
http://paa.fragland.net/hosted/myquestion/ here you find my question, thx -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Sorting output of MySQL Select Like queries
Can someone help me understand the problem with the approach I am trying or suggest a new approach? Basic Objective: Search several fields of a table for keywords/search terms and return the ID's for records containing those keywords. I would like to then sort those ID's in descending order of the number of times there is a match. Approach: (Note: because my host has not updated My SQL, I cannot use the Match function) I am searching each table field for each search term then merging the resulting arrays. I then perform an array_count_values on the final array to determine frequency, rsort that to get descending order. See query function script after Problems. Problems: 1) I get the following error message when the array_count_values function is reached:: Can only count STRING and INTEGER values! This is because the values in the array are also arrays but I don't know how to convert them to the single values. 2) How do I reverse sort and convert the associative array that is generated by array_count_values back to the ID's that have become keys? Query Funciton Example: $test_array=Search_Titles($item); $count_array=array_count_values($test_array); function Search_Titles($item) { //get candidates saved group preferences $sql=SELECT CID FROM abbreviated WHERE CSkills like '% $item%'; $result = @mysql_query($sql) or die(Couldn't execute title match query.); if (!$result) return false; $num_groups = @mysql_num_rows($result); if ($num_groups ==0) return false; // create an array of groups $result = db_result_to_array($result); return $result; } Please reply to my email address as well as the newsgroup: [EMAIL PROTECTED] Thanks, Rick -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] php-mysql-and the elusive eval statement....
I'm having a php/mysql problem using the eval statement. what I'm done is created a template that is database driven ie. the document is setup so that all of the head, leftside, body, right and bottom are all text comming from database query returns. all database returns are valid tested code. all peices have been tested in their own pages and shown to work. inside the text of the returns supposedly can be php code. using the eval statment i can get the html code to return no problem(page works correctly). when the code has php code in it it doesn't seem to work. using the eval statement I should be able to do something like eval (?$string) and it should evaluate the the code within thus when it comes to a ?php string it'll evaluate the next bit as php code. (right?) somehow it doesn't. here's a small snipit of the code. ?php // ** // Header of Document // ** eval (?$top); ? center /td /tr /table /div div name=middle table width=780 border=0 cellpadding=0 cellspacing=0 tr td width=120 bgcolor=?php echo $leftcolor;? border=0 div name=leftbar the inside code just goes out and grabs a counter value, updates it +1 and returns the original counter val. I get nothing(well I get a space, where somehthing is suppose to be returned). the code inside works also as independently in a page by itself it'll return valid counter information and does the update. I'm about ready to pull my hair out, (good thing my wife keeps it about 1/2 inch long, heh heh). tie all of my computers together with a big rope and use them as boat anchors. (I don't even have a boat, so I'll just have to throw them in) so any help avoiding this costly situation would be appreciated thanks in advance R --- Never, Never buy beer! Make it! It tastes better!! Woke up this mornin' an' I had myself a beer. Yea, Ah woke up this mornin' an' I had myself a beer. The futures' uncertain and the end is always near. -Jim Morrison, Roadhouse Blues Fill with mingled cream and amber, I will drain that glass again. Such hilarious visions clamber Through the chambers of my brain. Quaintest thoughts--queerest fancies, Come to life and fade away: I am drinking ale today. --Edgar Allan Poe -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] php + interbase
On Thursday 01 November 2001 20:34, Jacek Krywult wrote: I have an error messagge when try to configure php.ini to use php_interbase.dll. FoxServ, php ver. 4.0.6 ( I tried also 4.0.4 ), win 98. interbase local from Delphi 5. I think that local interbase installed with delphi is pre version 6.0, and the dll you're using is compiled against version What is the way to use interbase with php ? greetings, Jacek Krywult PHP works best with interbase 6.0 (or firebird) and up, so i suggest removing local interbase and installing the newer one. -- Meir Kriheli -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] MySQL: Alphabetizing title results in library format
Hi, seems a bit strange. Try this select (use mysql client) mysql select title,if(title like 'The %','yes','no') from titles; if it works try substring functions and if that works try 'order by' clause. It's at least working on server v. 3.23, so in case it will not work find out in the 'list of changes' (for version 3.23) if this feature is not new. In such case tell whoever to upgrade. :( I can't find any error in your query (and at least at 3.23 it's working!) Regards On Thursday 01 November 2001 10:19, you wrote: Petr Tuma wrote: What error message it produce? Ok, table titles is composed of: +--+-++ | titlesid | releaseyear | title | +--+-++ mysql select *,(case when title like 'The %' then substring (title, 5, 255) when title like 'A %' then substring (title, 3, 255) when title like 'An %' then substring (title, 4, 255) else title end) as sort_col from titles order by sort_col; ERROR 1064: You have an error in your SQL syntax near 'when title like 'The %' then substring (title, 5, 255) when title like 'A %' the' at line 1 -- Petr Tuma IT Manager, M.Ward Manufacturing -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] php-mysql-and the elusive eval statement....
I would think that you can't use '?' nad '?' special tags in the eval function (at least use only one of it). Try this ?php eval(?hi?); ? But I think that what will is that it will stop execution on the '?' sign (end of PHP code) and print out an error like 'missing closing quote' or such. On Thursday 01 November 2001 23:05, you wrote: I'm having a php/mysql problem using the eval statement. what I'm done is created a template that is database driven ie. the document is setup so that all of the head, leftside, body, right and bottom are all text comming from database query returns. all database returns are valid tested code. all peices have been tested in their own pages and shown to work. inside the text of the returns supposedly can be php code. using the eval statment i can get the html code to return no problem(page works correctly). when the code has php code in it it doesn't seem to work. using the eval statement I should be able to do something like eval (?$string) and it should evaluate the the code within thus when it comes to a ?php string it'll evaluate the next bit as php code. (right?) somehow it doesn't. here's a small snipit of the code. ?php // ** // Header of Document // ** eval (?$top); ? center /td /tr /table /div div name=middle table width=780 border=0 cellpadding=0 cellspacing=0 tr td width=120 bgcolor=?php echo $leftcolor;? border=0 div name=leftbar the inside code just goes out and grabs a counter value, updates it +1 and returns the original counter val. I get nothing(well I get a space, where somehthing is suppose to be returned). the code inside works also as independently in a page by itself it'll return valid counter information and does the update. I'm about ready to pull my hair out, (good thing my wife keeps it about 1/2 inch long, heh heh). tie all of my computers together with a big rope and use them as boat anchors. (I don't even have a boat, so I'll just have to throw them in) so any help avoiding this costly situation would be appreciated thanks in advance R --- Never, Never buy beer! Make it! It tastes better!! Woke up this mornin' an' I had myself a beer. Yea, Ah woke up this mornin' an' I had myself a beer. The futures' uncertain and the end is always near. -Jim Morrison, Roadhouse Blues Fill with mingled cream and amber, I will drain that glass again. Such hilarious visions clamber Through the chambers of my brain. Quaintest thoughts--queerest fancies, Come to life and fade away: I am drinking ale today. --Edgar Allan Poe -- Petr Tuma IT Manager, M.Ward Manufacturing -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]