[PHP-DB] DISTINCT in SQL query

2001-08-27 Thread Scott Mebberson
Hi Guys, I am retriving information based across three tables, here is the SQL statement SELECT DISTINCT title, filelocation, filename, ranking, summary FROM pdf, words, searchwords WHERE words.id = searchwords.word_id AND pdf.id = searchwords.pdf_id AND LCASE(words.word) LIKE

Re: [PHP-DB] Getting SQL queries from existing DB

2001-08-27 Thread Andrey Hristov
Get and install phpMyAdmin. It can dump to you, the stucture, the data or both. Then save them from the browser(better with lynx because you can get the source of a page piped). And pipe it to another mysql, or use it in another phpMyAdmin. Andrey Hristov IcyGEN Corporation

Re: [PHP-DB] DISTINCT in SQL query

2001-08-27 Thread Andrey Hristov
Try with SELECT distinct title,filelocation,filename,ranking,summary FROM pdf LEFT JOIN searchwords USING(id) LEFT JOIN words USING(id) WHERE LCASE(words.word) LIKE LCASE('%$searchstr%') ORDER BY ranking DESC; Have in mind that all text fields in MySQL except with added clause BINARY, or BLOBs

[PHP-DB] br appear in Text file

2001-08-27 Thread Jack
Dear all I'm writing a script which will greb the data from a user input form into a text file (txt file), but the problem is that when the data had passed to the txt file, there will be some thing like the br and black square appear inside the file. This is affecting to display the data from

[PHP-DB] Error after upgrade 4.0.4pl1 - 4.0.6

2001-08-27 Thread Alex V.Varavva
Hi! After upgrade PHP 4.0.4pl1 to version 4.0.6 This script not worked ?php ... $db = ibase_connect ($DB_WWW, $USER, $PASS,'WIN1251'); $stmt=SELECT YPID FROM TOP_TODAY WHERE DT('TODAY'-24); $sth = ibase_query ($db, $stmt,$res); ... ? InterBase: Dynamic SQL Error SQL error code = -206 Column

Re: [PHP-DB] br appear in Text file

2001-08-27 Thread Andrey Hristov
See: 1)strip_tags 2)fgetss 3)preg_replace('|(.*?)(.*?)(/.*?)|','\2',$string); Example: ?php $string=a href=''alabala/a; $string=preg_replace('|(.*?)(.*?)(/.*?)|','\2',$string); echo htmlspecialchars($string); ? Produces : alabala Andrey Hristov IcyGEN Corporation http://www.icygen.com 99%

[PHP-DB] Compiling MySQL Database on LinuxPPC

2001-08-27 Thread George Pitcher
Hi all, Frustrated by failing compile: This is the message I get: c++: Internal compiler eror: program cc1plus got fatal signal 15 make[3]: ***[field.o] Error 1 make[3]: Leaving directory '/usr/src/mysql-3.23.37/sql' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory

RE: [PHP-DB] Getting SQL queries from existing DB

2001-08-27 Thread Rick Emery
Use mysqldump utility (see MySQL manual, section 14.5) shell mysqldump [OPTIONS] database [tables] ORmysqldump [OPTIONS] --databases [OPTIONS] DB1 [DB2 DB3...] ORmysqldump [OPTIONS] --all-databases [OPTIONS] -Original Message- From: Andrey Hristov [mailto:[EMAIL

RE: [PHP-DB] go to another URL

2001-08-27 Thread Rick Emery
header(Location: http://new.url.com/index.html; ); exit; This MUST be executed BEFORE any other data/html are displayed. -Original Message- From: Andrius Jakutis [mailto:[EMAIL PROTECTED]] Sent: Sunday, August 26, 2001 4:49 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] go to another URL

Re: [PHP-DB] Getting SQL queries from existing DB

2001-08-27 Thread Andrey Hristov
phpMyAdmin can do this also. Can dump the data and structure to SQL Statements. The problem appears if the table for dumping is 100,000 rows or something bigger than the computer can get and start swapping. Andrey Hristov IcyGEN Corporation http://www.icygen.com 99% - Original Message

Re: [PHP-DB] br appear in Text file

2001-08-27 Thread Justin Buist
If you're getting a literal br in the file then I'd have to say you're either typing one in the text box or have your HTML putting on in there for you w/out knowing it. If it's a new line or a carriage return in the file that's a different matter. When somebody submits data to you in a textarea

Re: [PHP-DB] Compiling MySQL Database on LinuxPPC

2001-08-27 Thread Justin Buist
One of a few things: - Broken compiler. If it happens in the same place everytime it's in the software. - Out of memory. If you made it with something like 'make -j 200' this is likely. If you only allowed a single g++ process to run with just 'make' this likely isn't the case. -

Re: [PHP-DB] Compiling MySQL Database on LinuxPPC

2001-08-27 Thread George Pitcher
Justin, Thanks. It appears to happen in the same place each time I try (4 attempts as its not that quick [about 1 hr each try]). So should I download a new compiler (is it the gcc++ or if not, what?)? George - Original Message - From: Justin Buist [EMAIL PROTECTED] To: George Pitcher

Re: [PHP-DB] Compiling MySQL Database on LinuxPPC

2001-08-27 Thread Justin Buist
If it fails, and you type 'make' again it will pick up right where it left off... which means it's bad memory or some other hardware problem usually. Justin Buist Trident Technology, Inc. 4700 60th St. SW, Suite 102 Grand Rapids, MI 49512 Ph. 616.554.2700 Fx. 616.554.3331 Mo. 616.291.2612 On

[PHP-DB] host variables

2001-08-27 Thread Liris Muller
I use DB2 and I have a Long Varchar field. I need use host variables to insert.How I make is in php ? Ex.: (this code not insert datas because descr=long varchar) $query = insert into tb_public values ('$cod','$descr','$codr'); I need a function in php or a mode to declare host

[PHP-DB] Accessing fields with the same name in MySQL

2001-08-27 Thread Trevor Lanyon
tbl_job --- id name_id job tbl_name id first last SQL --- select * from tbl_name, tbl_job where tbl_name.id = tbl_job.name_id; I use mysql_fetch_object to retrieve a row from the above result set. I have two objects, objName and objJob. The constructor for both objects accept a

RE: [PHP-DB] Troubles in ODBC Land

2001-08-27 Thread Andrew Hill
Jonathan, You should be getting some errors if the odbc_connect is failing - what are they? Typical problems include forgetting to set ODBCINI and LD_LIBRARY_PATH envrionment variables in your script (via putenv(); ) Also, you may wish to use --with-iodbc instead of --with-unixodbc - it comes

RE: [PHP-DB] Accessing fields with the same name in MySQL

2001-08-27 Thread Rick Emery
Since you're matching on id, why does it matter which table it came from? It came from both. Perhaps, I do not understand your question. rick -Original Message- From: Trevor Lanyon [mailto:[EMAIL PROTECTED]] Sent: Monday, August 27, 2001 1:13 PM To: [EMAIL PROTECTED] Subject: [PHP-DB]

RE: [PHP-DB] Accessing fields with the same name in MySQL

2001-08-27 Thread Howard Picken
You could try returning the whole info with an alias i.e. select tbl_job.id AS jobno, tbl_job.name.id, tbl_job.job, tbl_name.* from tbl_name, tbl_job where tbl_name.id = tbl_job.name_id; You should then be able to refer to the tbl_job.id as jobno in any $row function i.e.

[PHP-DB] Re: br appear in Text file

2001-08-27 Thread Andy Ladouceur
Hi Jack, The 'black box' you see is a newline, which can be removed by doing this: $string=str_replace(\n,,$string); $string=str_replace(\r,,$string); That will replace \n (The newlines) and \r (The returns) with nothing, getting rid of your problem. Hope this helps, -Andy Jack [EMAIL PROTECTED]

[PHP-DB] Re: Troubles in ODBC Land

2001-08-27 Thread Alexandre Santos
What DB are you trying to use? Alex Jonathan Hilgeman wrote: I'm on a FreeBSD 4.2 box running Apache 1.3.14+OpenSSL with mod_php4 (4.0.3). I am attempting to set up ODBC for this box, and it's giving me problems. First, I installed unixODBC (www.unixodbc.org), which went fairly smooth.

[PHP-DB] CSV TO MYSQL

2001-08-27 Thread Rupert
Ok, this is my issue - hope someone can help. Suppose I also need to get this out of the way too - I am a Newbie (god..I hate that word...but it's true.grin!) Anyway, I have a list of email address that I want to dump into a database called (news) - eg. [EMAIL PROTECTED] [EMAIL PROTECTED]

Re: [PHP-DB] CSV TO MYSQL

2001-08-27 Thread Chris Hobbs
How about this: ?php $emailstring = [EMAIL PROTECTED];[EMAIL PROTECTED];[EMAIL PROTECTED]; @emails = explode(;, $emailstring); foreach($emails as $email) { echo INSERT INTO news VALUES('$email');\n; } ? Rupert wrote: Ok, this is my issue - hope someone can help. Suppose I also need to

RE: [PHP-DB] CSV TO MYSQL

2001-08-27 Thread Ryan Marrs
Don't forget you can just as easily replace the ; with any character you may be separating the email addresses using (for instance a comma) Ryan -Original Message- From: Chris Hobbs [mailto:[EMAIL PROTECTED]] Sent: Monday, August 27, 2001 11:16 PM To: PHP-DB List Subject: Re: [PHP-DB]

Re: [PHP-DB] CSV TO MYSQL

2001-08-27 Thread Chris Hobbs
Are you running php3 or php4? 'foreach' was added in php4, which might explain your error. If you're running php3, try replacing that line with: while(list($key,$email) = each($emails)) { I don't know if this works in php3 or not, but would be worth a shot. Rupert L. Hussey wrote: Hi Chris

[PHP-DB] Resource ID

2001-08-27 Thread Scott Mebberson
Hi Guys, I am querying my MySQL database with this sql: $q-ezi_query($db, SELECT id FROM words WHERE word='$word'); ezi_query() is just a class - an database layer so the databases can be swapped. Then I check the result to see if it worked. But all I get in the result is Resource id #5 -

[PHP-DB] Postgres and php shell scripting

2001-08-27 Thread John Starkey
Anyone know if there's a trick to using PHP as a shell script and accessing postgres? I keep getting pg_exec not found yet it works in a browser. I'm using my normal abstraction class. All normal filesystem, string, etc functions are available. Just can't get the pg functions to work. TIA,

Re: [PHP-DB] Postgres and php shell scripting

2001-08-27 Thread Jason Brooke
Anyone know if there's a trick to using PHP as a shell script and accessing postgres? I keep getting pg_exec not found yet it works in a browser. I'm using my normal abstraction class. All normal filesystem, string, etc functions are available. Just can't get the pg functions to work. TIA,

Re: [PHP-DB] Postgres and php shell scripting

2001-08-27 Thread John Starkey
Yep that was it. Thanks. Thus spake Jason Brooke ([EMAIL PROTECTED]): Anyone know if there's a trick to using PHP as a shell script and accessing postgres? I keep getting pg_exec not found yet it works in a browser. I'm using my normal abstraction class. All normal filesystem, string,

[PHP-DB] Linux/PHP/Interbase

2001-08-27 Thread Todd Cary
I am new to the Linux environment - currently using IIS/PHP/Interbase. What do I need in order to have Interbase running with PHP on a linux 7.1 platform? I have Interbase 6 installed and I have PHP 4.0.4pl1 loaded. The php.ini file has the extension interbase.so uncommented, but I do not see

[PHP-DB] Error in SQL syntax

2001-08-27 Thread Alex V.Varavva
Hi! On execute script ?php ... $db = ibase_connect ($DB_WWW, $USER, $PASS,'WIN1251'); $stmt='SELECT YPID FROM TOP_TODAY WHERE DT(TODAY-24)'; $sth = ibase_query ($db, $stmt); ... ? I have error InterBase: Dynamic SQL Error expression evaluation not supported in ./test.php Why ? This is