Re: [PHP-DB] ADDING DATES

2002-01-13 Thread Miles Thompson
Yep, maybe it is, but when a post starts with " ... but i am getting lazy", I get a bit peeved. The implication is "Do my work for me." It's different when the context is I want to do this ... tried this ... results aren't right ... please help. Miles At 06:04 PM 1/13/2002 -0800, Daniel Bart

Re: [PHP-DB] Sanitizing user input for interaction with DB.

2002-01-13 Thread Bogdan Stancescu
I've started a thread on the topic some time ago on the php list, after some extensive reading and testing and these were the main conclusions: 1.1. ALWAYS pass "addslashed" values and always pass them quoted in the SQL statement. That is "insert into table1 set id='$id'" even if $id is known to a

RE: [PHP-DB] Sanitizing user input for interaction with DB.

2002-01-13 Thread Beau Lebens
Hi Benny, I know this is a bit of a run-around again, but try the annotated manual on php.net, it has some good examples of using things here and there. Specifically useful functions are htmlspecialentities() htmlspecialchars() addslashes() stripslashes() nl2br() also, as far as using regexps g

[PHP-DB] Sanitizing user input for interaction with DB.

2002-01-13 Thread C. Bensend
Hey folks, Let me preface this with the fact that I know information like this exists online, but it's a bear trying to find good examples. I checked the list archives, and got minimal information. Also, I'm posting to this list rather than the -users because this does target a databas

Re: [PHP-DB] ADDING DATES

2002-01-13 Thread Peter J. Schoenster
> At 12:17 AM 1/14/2002 +, Pedro M. S. Oliveira wrote: > > > >Hi all, first of all i'm sorry to ask this but i am getting lazy and > >i bet you all can answer me in a couple of code lines. i want to add > >some days to the the result of the date php function. how can i had > >lets say 3 days

RE: [PHP-DB] Can't use field names in print

2002-01-13 Thread Beau Lebens
you should be able to just change the mysql_fetch_row to a mysql_fetch_array and then use the names rather than the numbers in your print (modified below, not tested :) // "); // } // ?> /beau -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For ad

Re: [PHP-DB] Can't use field names in print

2002-01-13 Thread planomax
Thanks for the quick response. I left out the part you mention, here is the whole code (the one that works); "); } ?> I just can't seem to be able to access the array using the column names from the table. Pete "Beau Lebens" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAI

RE: [PHP-DB] Can't use field names in print

2002-01-13 Thread Beau Lebens
you need to use the *_fetch_array() functions i.e. if you are using MySQL $SQL = "something"; // build SQL query $result = mysql_query($SQL); // execute query, save all results in $result $firstResult = mysql_fetch_array($result); // create an array containing each returned record // subsequent

[PHP-DB] Can't use field names in print

2002-01-13 Thread planomax
To output each row, this works: print("$row[0] - $row[1] - $row[2]"); But using the table's field names, I don't see anything: $ID=$row["ID"]; $test1=$row["test1"]; $test2=$row["test2"]; print ("$ID - $test1 - $test2"); I'm used to using Cold Fusion and want to learn PHP. Any help wou

Re: [PHP-DB] ADDING DATES

2002-01-13 Thread Daniel Barton
Miles, Hmm... "RTFM!" .. That's a pretty unproductive post. Pedro, There are two PHP functions that will suffice. date() and mktime(). I've cut and pasted this from the PHP manual: $tomorrow = mktime (0,0,0,date("m") ,date("d")+1,date("Y")); $lastmonth = mktime (0,0,0,date("m")-1,date("d"),

[PHP-DB] The New Guy

2002-01-13 Thread Christopher J. Crane
I do a lot of work with Perl and have decided to see what this PHP is all about. The best way for me to do that, is to just do a project. Here is what I am looking to do. I would like to use PHP and the SQL language on a CSV or Flat File Database. A lot of my work is on unix system that people wan

Re: [PHP-DB] ADDING DATES

2002-01-13 Thread Miles Thompson
RTFM! At 12:17 AM 1/14/2002 +, Pedro M. S. Oliveira wrote: >Hi all, first of all i'm sorry to ask this but i am getting lazy and i bet >you all can answer me in a couple of code lines. >i want to add some days to the the result of the date php function. >how can i had lets say 3 days? >ex:

[PHP-DB] ADDING DATES

2002-01-13 Thread Pedro M. S. Oliveira
Hi all, first of all i'm sorry to ask this but i am getting lazy and i bet you all can answer me in a couple of code lines. i want to add some days to the the result of the date php function. how can i had lets say 3 days? ex: (pseudo code) Thanks Pedro -- PHP Database Mailing List (http:/

Re: [PHP-DB] Re: Defining Arrays

2002-01-13 Thread Bogdan Stancescu
(Well, actually $text[1] should be "e" ;-) ) Bogdan Bogdan Stancescu wrote: > Why don't you try > $denc[]=substr($text,$i,1); > > Not to mention that $text[1] already is "h". > > Bogdan -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additiona

Re: [PHP-DB] Re: Defining Arrays

2002-01-13 Thread Bogdan Stancescu
Why don't you try $denc[]=substr($text,$i,1); Not to mention that $text[1] already is "h". Bogdan Thomas \"omega\" Henning wrote: > Something i forgot > when i echo("$denc[1]"); then it types Array out !!! > "Thomas "Omega" Henning" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">new

Re: [PHP-DB] Re: Moving from MySQL to MSSQL Server 2000

2002-01-13 Thread Manuel Lemos
Hello, Boaz Yahav wrote: > > You realize that what they did will never work with an Ecommerce auction > site where everything must be in real-time... Why do you say that? Because you think you will need to handle as much requests as they do but always with upto date information? AFAIK, most of

Re: [PHP-DB] Re: Moving from MySQL to MSSQL Server 2000

2002-01-13 Thread Manuel Lemos
Hello, Boaz Yahav wrote: > My main problem is that MySQL is not "Cluster Aware". > I never heard of a MySQL server being able to perform a "Fail Over" to > another node. > > Did you? I never used MySQL in a cluster myself, but AFAIK, if it would not do fail-over, what good a cluster would be fo

Re: [PHP-DB] Re: Moving from MySQL to MSSQL Server 2000

2002-01-13 Thread Manuel Lemos
Hello, Boaz Yahav wrote: > > It's not just that... > For example, when I want to backup the MySQL server (and we are talking > of a few GB of data) the server is practically dead while making the > dump. MSSQL Server 2000 (for example) does that in the background and > you can keep working... >

Re: [PHP-DB] Re: [PHP] convert yyyy/mm/dd to mm/dd/yyyy, how?

2002-01-13 Thread Rasmus Lerdorf
You use the right tool for the job. MySQL is going to have to format the date field for the return anyway. It makes sense to simply tell MySQL your preferred format instead of having it returned to you in the wrong format and then you having to apply more gear to get it into the right one. -Ras

RE: [PHP-DB] Re: Moving from MySQL to MSSQL Server 2000

2002-01-13 Thread ted
Yes. PostgreSQL. On Sun, 13 Jan 2002, Boaz Yahav wrote: > It's not just that... > For example, when I want to backup the MySQL server (and we are talking > of a few GB of data) the server is practically dead while making the > dump. MSSQL Server 2000 (for example) does that in the background an

Re: [PHP-DB] Re: Moving from MySQL to MSSQL Server 2000

2002-01-13 Thread Heikki Tuuri
Hi! InnoDB is multiversioned. You can start a transaction, dump all your tables inside a single transaction using SELECT INTO OUTFILE and you get a snapshot of your database at a precise point of time. Because of multiversioning, your tables are not locked during the dump. I am also writing a (n

RE: [PHP-DB] Re: Moving from MySQL to MSSQL Server 2000

2002-01-13 Thread Boaz Yahav
It's not just that... For example, when I want to backup the MySQL server (and we are talking of a few GB of data) the server is practically dead while making the dump. MSSQL Server 2000 (for example) does that in the background and you can keep working... Any ideas? -Original Message- F

RE: [PHP-DB] Re: Moving from MySQL to MSSQL Server 2000

2002-01-13 Thread Boaz Yahav
You realize that what they did will never work with an Ecommerce auction site where everything must be in real-time... -Original Message- From: Manuel Lemos [mailto:[EMAIL PROTECTED]] Sent: Saturday, January 12, 2002 11:25 PM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] Re: Moving from MyS

Re: [PHP-DB] Re: [PHP] convert yyyy/mm/dd to mm/dd/yyyy, how?

2002-01-13 Thread DL Neil
Rasmus, I have held several datetime-related conversations with people recently, and another series about 'when'/whether to use PHP or MySQL functionality. Here you are, "the man" of PHP, advising Sander to use MySQL functionality! (and in marked contrast to the (biased) advice one might expec

[PHP-DB] Re: [PHP] convert yyyy/mm/dd to mm/dd/yyyy, how?

2002-01-13 Thread Rasmus Lerdorf
MySQL has plenty of functions to return dates to you in any format you specify. Please read http://mysql.com/documentation/mysql/bychapter/manual_Reference.html#Date_and_time_functions and pay special attention to the DATE_FORMAT() function. -Rasmus On Sun, 13 Jan 2002, Sander Peters wrote:

[PHP-DB] Re: [PHP] convert yyyy/mm/dd to mm/dd/yyyy, how?

2002-01-13 Thread Jonathan David Edwin Wright
Hiya, Personally, I use the following bit of code. All it does is take a 14 digit timestamp and convert it into a unix timestamp: function date($date) { //Extract the parts from the date $year = substr($date, 0, 4); $month = substr($date, 4, 2); $day = substr($date, 6, 2);

[PHP-DB] convert yyyy/mm/dd to mm/dd/yyyy, how?

2002-01-13 Thread Sander Peters
Hello everybody, convert /mm/dd to mm/dd/, how? MYSQL does everything in /mm/dd. I live in the Netherlands and we are use to the format dd/mm/. What's the best way to display it as mm/dd/ in a table on a query? My first idea whas to split the date up in vars in php and then

[PHP-DB] Re: Defining Arrays

2002-01-13 Thread Thomas \"omega\" Henning
Something i forgot when i echo("$denc[1]"); then it types Array out !!! "Thomas "Omega" Henning" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hello, > > I'm curently working on an Encryption Bot for IRC that sends encrypted > messages to other bots linked 2 i

[PHP-DB] Defining Arrays

2002-01-13 Thread Thomas \"omega\" Henning
Hello, I'm curently working on an Encryption Bot for IRC that sends encrypted messages to other bots linked 2 it and users that are log into it. How i define an Array so i can use something like this Theoraticly (in C++ point of view) that should print out "h". Any idias helps alot Thanks Thom

Re: [PHP-DB] properly a simple question

2002-01-13 Thread Miles Thompson
Barry, You're 3/4 of the way there. You understand how data is normalized, and you have the proper keys so that you can link your tables in a multi-table join. For specific syntax you should check the MySQL manual, but what you want is roughly this ..and I'll make up some field names. (Becaus

Re: [PHP-DB] properly a simple question

2002-01-13 Thread DL Neil
Barry, This is properly a simple question but I can't figure it out. =please don't ask im-proper questions, this is a family environment!!! Lets say I've got there tables: table1(art_id,artist), table2(song_id,art_id,song), table3(image_id,art_id,image). What I'm trying to do is get 1 image dis

[PHP-DB] properly a simple question

2002-01-13 Thread Barry Rumsey
This is properly a simple question but I can't figure it out. Lets say I've got there tables: table1(art_id,artist), table2(song_id,art_id,song), table3(image_id,art_id,image). What I'm trying to do is get 1 image displayed with the songs on that album displayed next to it. All I can get is 1im

RE: [PHP-DB] Re: Moving from MySQL to MSSQL Server 2000

2002-01-13 Thread Boaz Yahav
I will read this article and let you know :) My main problem is that MySQL is not "Cluster Aware". I never heard of a MySQL server being able to perform a "Fail Over" to another node. Did you? -Original Message- From: Manuel Lemos [mailto:[EMAIL PROTECTED]] Sent: Saturday, January 12, 20

Re: [PHP-DB] Dumb Question??

2002-01-13 Thread Chris Boer
Look at the filemtime() function that should do the trick Greetz Whosnext "Russ Michell" <[EMAIL PROTECTED]> wrote in message news:SIMEON.10112131234.B@k1c. anglia.ac.uk... > Sorry! just read-read my post, it should have been: > > particular column ('modified') *NOT* to appear under specific

[PHP-DB] Re: Copying a MySQL Table

2002-01-13 Thread Chris Boer
Try using phpmysqladmin then it is PLAIN EASY... Greet Whosnext "Spyproductions Support Team" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > How does one copy a Mysql table? > > I poked around on the mysql site and found conventions for renaming one, but >