Re: [PHP-DB] changing datatypes in the query

2003-08-27 Thread CPT John W. Holmes
From: Matt Babineau [EMAIL PROTECTED] On Tue, 2003-08-26 at 11:21, Matt Babineau wrote: Tough question (I think). I am pulling some numbers out of a data base, currently they are stored in a blob. When I try to order by user_hits desc it does a text ordering, not a numerical ordering. Is

Re: [PHP-DB] timestamp formatting on display?

2003-08-27 Thread CPT John W. Holmes
From: Aaron Wolski [EMAIL PROTECTED] Having a brain laps and not sure where in the manual to look and sadly I need a QUICK solution. I have a date formatted in a table like: 20030826132457 Now.. I went to MySQL timestamp from UNIX timestamps because I like the readability of them when just

[PHP-DB] MySQL, PHP or ghost?

2003-08-27 Thread Peter Beckman
Seems that either I don't understand mysql, or something. My table, with the non-important things removed... mysql explain plate; +-+---+--+-+-++ | Field | Type | Null | Key | Default

[PHP-DB] Re: Database backup

2003-08-27 Thread Roberto Dragva Filho
Try mysqldump mysqldump -u username -p'password' -A backup_file_name.dump you can copy backup_file_name.dump to CD. roberto Chris Payne [EMAIL PROTECTED] escreveu na mensagem news:[EMAIL PROTECTED] Hi there everyone, Is there a quick way I can backup all my databases on Linux so I can

Re: [PHP-DB] Database backup

2003-08-27 Thread John W. Holmes
Chris Payne wrote: Hi there everyone, Is there a quick way I can backup all my databases on Linux so I can download them to my HD/Burn them onto CD? I've started a very large travel project and there is going to be over 100 DB's in the end, each with who knows how many tables and going through

Re: [PHP-DB] Database backup

2003-08-27 Thread ramki
mysqldump -A /path_to_file/filename.sql for eg: mysqldump -A /tmp/alldatabases.sql This generates a sql file which can be used as backup or for restore... Hope it helps.. -ramki Chris Payne wrote: Hi there everyone, Is there a quick way I can backup all my databases on Linux so I can

[PHP-DB] Problem in executing linux command from PHP

2003-08-27 Thread Gnanavel
I have problem in executing linux command $output=exec(ls -a); echo pre$output/pre; the above coding works, but $output=exec(cp file1 file2); echo pre$output/pre; does not works. can any one help me out of this problem - Sify Mail - now with

Re: [PHP-DB] Database backup

2003-08-27 Thread otherguy
http://www.mysql.com/doc/en/Backup.html This question might be a little bit more relevant on the mySQL-help list... At the very least, if that page doesn't do it for you, you might be able to get a little bit more expertise about backups of very large installations there. -Cameron Wilhelm On

RE: [PHP-DB] Database backup

2003-08-27 Thread Jacob A. van Zanen
How'bout backing up your data directory (ies) Otherwise you can maybe use mysql_dump in a batch?? Jack -Original Message- From: Chris Payne [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 26, 2003 11:46 PM To: php Subject: [PHP-DB] Database backup Hi there everyone, Is there a

Re: [PHP-DB] Database backup

2003-08-27 Thread jeffrey_n_Dyke
use mysqldump. you can dump all databases (--all-databases) or list them individually. http://www.mysql.com/doc/en/mysqldump.html hth Jeff

Re: [PHP-DB] Database backup

2003-08-27 Thread David Smith
Just do a mysqldump on the command line. It will dump a whole bunch of SQL code that can be used to recreate the database in the event of disaster. You could even pipe the output to gzip to compress it. mysqldump --all-databases -u root | gzip -c mysql_backup.gz That works fine for me.

Re: [PHP-DB] MySQL, PHP or ghost?

2003-08-27 Thread Ignatius Reilly
Read the MySQL manual. 0 value is interpreted as 2000. Your empty string is converted to an integer, thus 0. HTH Ignatius _ - Original Message - From: Peter Beckman [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, August 27, 2003 3:39 AM Subject: [PHP-DB]

RE: [PHP-DB] Logic Help...

2003-08-27 Thread NIPP, SCOTT V (SBCSI)
Thanks for the feedback. This seems to have helped, but something is still not working with the logic. Here is the updated code: ?php while($cntr != 0) { $cntr--; if (($shell[$cntr] == ) || ($grp[$cntr] == )) { echo p align=\center\font color=\#99\ size=\4\Sorry,

Re: [PHP-DB] MySQL, PHP or ghost?

2003-08-27 Thread David T-G
Peter -- ...and then Peter Beckman said... % % Seems that either I don't understand mysql, or something. Looks like it, though I admit that the manual doesn't adequately explain your results. Check out section 6.2.2.4 for details. % % My table, with the non-important things removed... ... %

Re: [PHP-DB] MySQL, PHP or ghost?

2003-08-27 Thread Peter Beckman
On Wed, 27 Aug 2003, Ignatius Reilly wrote: Read the MySQL manual. Hmmm, I thought I did. 6.2.2.4: Illegal YEAR values are converted to . 0 value is interpreted as 2000. Your empty string is converted to an integer, thus 0. What confuses me (what I can't find) is why a quoted empty

RE: [PHP-DB] MySQL, PHP or ghost?

2003-08-27 Thread Griffiths, Daniel
its nothing to do with php as your working from the shell in your eg. mysql will default to 2000 for a year value if you pass it as an entry because it will accept short values for the years this century, eg pass it 1 and it'll give you 2001, so it thinks is nothing. if you want to default to

Re: [PHP-DB] Problem in executing linux command from PHP

2003-08-27 Thread CPT John W. Holmes
From: Gnanavel [EMAIL PROTECTED] I have problem in executing linux command $output=exec(ls -a); echo pre$output/pre; the above coding works, but $output=exec(cp file1 file2); echo pre$output/pre; does not works. can any one help me out of this problem Riddle me this... exec()

Re: [PHP-DB] MySQL, PHP or ghost?

2003-08-27 Thread Peter Beckman
On Wed, 27 Aug 2003, David T-G wrote: Looks like it, though I admit that the manual doesn't adequately explain your results. Check out section 6.2.2.4 for details. I did; see my previous (moments ago) email on my read on that manual section. % So my assumption is that if I insert with

Re: [PHP-DB] MySQL, PHP or ghost?

2003-08-27 Thread David T-G
Peter, et al -- ...and then Peter Beckman said... % % On Wed, 27 Aug 2003, David T-G wrote: % % Looks like it, though I admit that the manual doesn't adequately explain % your results. Check out section 6.2.2.4 for details. % % I did; see my previous (moments ago) email on my read on that

Re: [PHP-DB] MySQL, PHP or ghost?

2003-08-27 Thread Ruprecht Helms
Hi Peter Beckman, Seems that either I don't understand mysql, or something. My table, with the non-important things removed... mysql explain plate; +-+---+--+-+-++ | Field | Type |

RE: [PHP-DB] MySQL, PHP or ghost?

2003-08-27 Thread Griffiths, Daniel
It dosent say this in the docs but I presume its because you need to pass the value as a string or the value will result in , which in year terms is wrong because there never was a year . I guess their reasoning is that if you have passed a then you havent broken this rule and so it

Re: [PHP-DB] MySQL, PHP or ghost?

2003-08-27 Thread Peter Beckman
On Wed, 27 Aug 2003, Ruprecht Helms wrote: you have chosen a wrong format. The format for year is . With string the field years don't know what to do. Right -- and if it doesn't know what to do, why would it insert a value that isn't correct and not give me an error? It does give a

[PHP-DB] serving up images

2003-08-27 Thread Matthew Horn
I have about 25 or so images that I would like to serve up on my site's home page. I would like the image to change every 3 days or so. Does anyone have a hint as to how I might go about doing this in a simple fashion? I don't want it to be random, but I do want it to cycle through the images

[PHP-DB] Simple Referrer

2003-08-27 Thread Diana Cassady
Hi. This seems like it should be simple. I've had no problem doing this in other languages, but can find no reference to this function in the PHP manual. How can I get PHP to return the referring URL? Thanks. Diana [EMAIL PROTECTED] Will Work for Chocolate

[PHP-DB] Ifs, ands, or buts

2003-08-27 Thread Diana Cassady
Another one that should be easy that I am just not finding anywhere in the manual. How do I put an 'and' or an 'or' in an if statement? I know I could achieve the same results with multiple if statements, but that seems so inefficient. Lets say I wanted to check a bunch of fields to make sure

[PHP-DB] Got it - ifs ands or buts

2003-08-27 Thread Diana Cassady
I see it, now. I just went back to the last digest and reread the Logic question. It looks like we do have the II for an or. Just what I needed. Thanks for asking your question, Scott. You code example enlightened me. Diana [EMAIL PROTECTED] Will Work for Chocolate

[PHP-DB] MySQL query failing on apostrophe in data

2003-08-27 Thread Dillon, John
How do I avoid the problem in the subject hereto? SELECT query uses variable in the WHERE clause. Fails on the following query: SELECT Tbl.fld FROM Tbl WHERE Tbl.fld2='11301201 0603A HKA 3902 #3708_JD's AE Exp' AND ... John

[PHP-DB] RE: MySQL query failing on apostrophe in data

2003-08-27 Thread Dillon, John
Seemingly: http://www.php.net/manual/en/function.mysql-escape-string.php -Original Message- From: Dillon, John Sent: 27 August 2003 17:59 To: 'PHP-DB' Subject: MySQL query failing on apostrophe in data How do I avoid the problem in the subject hereto? SELECT query uses variable in

RE: [PHP-DB] MySQL, PHP or ghost?

2003-08-27 Thread Hutchins, Richard
Yeah, but Peter stated that he entered year= and the query inserted 2000 in the column. mysql update plate set year= where pid=65; Query OK, 1 row affected (0.01 sec) Rows matched: 1 Changed: 1 Warnings: 1 mysql select * from plate where pid=65;

RE: [PHP-DB] Logic Help...

2003-08-27 Thread Hutchins, Richard
Scott, What is the variable $cntr set to on your first iteration through the loop? I'm assuming that, in the real world, it can be set to about anything, but what value is it set with now while you're testing? I'd suggest adding echo $cntr; before your while statement so you can see what it's set

RE: [PHP-DB] Logic Help...

2003-08-27 Thread jeffrey_n_Dyke
if its never entering hte test process maybe you're not holding what you think you are in the arrays. each time through the loop, before the if statemetn, just add a print_r($shell[$cntr]) and/or print_r($grp[$cntr] == ). for that matter you could print_r both arrays so you can see exactly what

[PHP-DB] INFORMIX PROBLEM

2003-08-27 Thread Luigi Vellucci
Hi I'm trying to compile php 4.1.2 from the source RPM in RedHat 7.3 but I wasn't succesfully. Please does anybody know what it means the following error: *** Warning: Linking the shared library libphp4.la against the non-libtool *** objects /opt/informix/lib/esql/checkapi.o is not portable!

RE: [PHP-DB] Simple Referrer

2003-08-27 Thread Jennifer Goodie
Hi. This seems like it should be simple. I've had no problem doing this in other languages, but can find no reference to this function in the PHP manual. How can I get PHP to return the referring URL? Depends on your PHP version and webserver install. In most cases $_SERVER['HTTP_REFERER']

Re: [PHP-DB] Ifs, ands, or buts

2003-08-27 Thread Matt Matijevich
http://www.php.net/manual/en/language.operators.logical.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Simple Referrer

2003-08-27 Thread Matt Matijevich
$_SERVER[HTTP_REFERER] http://www.php.net/manual/en/reserved.variables.php#reserved.variables.server -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Ifs, ands, or buts

2003-08-27 Thread Sebastian Haag
Diana, Diana Cassady said: Another one that should be easy that I am just not finding anywhere in the manual. How do I put an 'and' or an 'or' in an if statement? I know I could achieve the same results with multiple if statements, but that seems so inefficient. Lets say I wanted to

RE: [PHP-DB] Ifs, ands, or buts

2003-08-27 Thread Jennifer Goodie
Lets say I wanted to check a bunch of fields to make sure they weren't empty. I can check one field by saying: if ($field1) { echo Field 1 is not empty; } I'd use empty() since certain values would cause your if to evalute to false http://www.php.net/manual/en/function.empty.php

FW: [PHP-DB] Simple Referrer

2003-08-27 Thread Dennis Cole
== Dennis Cole @ Sanford Weather - Sanford, MI, USA 5000 Weather Enthusiasts Can't Be Wrong! www.weathermatrix.net -Original Message- From: Dennis Cole [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 27, 2003 3:11 PM

RE: [PHP-DB] MySQL query failing on apostrophe in data

2003-08-27 Thread Jennifer Goodie
How do I avoid the problem in the subject hereto? SELECT query uses variable in the WHERE clause. Fails on the following query: SELECT Tbl.fld FROM Tbl WHERE Tbl.fld2='11301201 0603A HKA 3902 #3708_JD's AE Exp' AND ... Escape it. SELECT Tbl.fld FROM Tbl WHERE Tbl.fld2='11301201 0603A HKA

RE: [PHP-DB] MySQL query failing on apostrophe in data

2003-08-27 Thread Andy Green
try putting a \ before the apostrophe -Original Message- From: Dillon, John [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 27, 2003 12:59 PM To: 'PHP-DB' Subject: [PHP-DB] MySQL query failing on apostrophe in data How do I avoid the problem in the subject hereto? SELECT query uses

Re: [PHP-DB] Simple Referrer

2003-08-27 Thread Sebastian Haag
Diana, Diana Cassady said: Hi. This seems like it should be simple. I've had no problem doing this in other languages, but can find no reference to this function in the PHP manual. How can I get PHP to return the referring URL? Thanks. Diana [EMAIL PROTECTED] Will Work

Re: [PHP-DB] MySQL query failing on apostrophe in data

2003-08-27 Thread CPT John W. Holmes
From: Dillon, John [EMAIL PROTECTED] How do I avoid the problem in the subject hereto? SELECT query uses variable in the WHERE clause. Fails on the following query: SELECT Tbl.fld FROM Tbl WHERE Tbl.fld2='11301201 0603A HKA 3902 #3708_JD's AE Exp' AND ... Escape the single quote with a

Re: [PHP-DB] MySQL query failing on apostrophe in data

2003-08-27 Thread jeffrey_n_Dyke
if you're using php to generate this query you could use addslashes() to the piece that is holding 11301201 0603A HKA 3902 #3708_JD's AE Exp. this will escape the slashes making them \' similarly if you're getting \' in your return values you can use stripslashes() www.php.net/addslashes

Re: [PHP-DB] Simple Referrer

2003-08-27 Thread jeffrey_n_Dyke
$_SERVER['HTTP_REFERER'] hth jeff Diana Cassady

Re: [PHP-DB] INFORMIX PROBLEM

2003-08-27 Thread Martin Marques
El Mié 27 Ago 2003 16:01, Luigi Vellucci escribió: Hi I'm trying to compile php 4.1.2 from the source RPM in RedHat 7.3 but I wasn't succesfully. Please does anybody know what it means the following error: *** Warning: Linking the shared library libphp4.la against the non-libtool *** objects

[PHP-DB] Imageresizing for giffiles

2003-08-27 Thread Ruprecht Helms
Hi, here I've an example for dynamicly resizing jpg-files. How can do this for gif-files? Regards, Ruprecht ? mysql_connect(localhost,root); $result=mysql_db_query(chorportal,SELECT * FROM dirigent WHERE ID='$chorid'); while ($row = mysql_fetch_object($result)) {

Re: [PHP-DB] Logic Help...

2003-08-27 Thread CPT John W. Holmes
From: NIPP, SCOTT V (SBCSI) [EMAIL PROTECTED] Thanks for the feedback. This seems to have helped, but something is still not working with the logic. Here is the updated code: ?php while($cntr != 0) { $cntr--; if (($shell[$cntr] == ) || ($grp[$cntr] == )) { echo p