Re: [PHP-DB] Selct & show certain num records ?

2002-01-30 Thread Shooter
$order="time desc"; $sql="SELECT * from $table ORDER BY $order LIMIT 0,5" or die ("Cant do sql $sql");; that would get the latest news sorted on the time. Neil - Original Message - From: Dave Carrera <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, January 31, 2002 5:54 PM Su

[PHP-DB] Selct & show certain num records ?

2002-01-30 Thread Dave Carrera
Hi All I know this has been covered here before but can someone please remind me how to selct just the 5 latest records in my db and show them in list form. Just like phpbuilder.com dose I thank you in advance for repeating this information. Dave C :-) -- PHP Database Mailing List (http://

[PHP-DB] MSSQL Query - Unicode data in a Unicode-only collation or ntext data cannot be sent

2002-01-30 Thread sql
Getting this error: Warning: MS SQL message: Unicode data in a Unicode-only collation or ntext data cannot be sent to clients using DB-Library (such as ISQL) or ODBC version 3.7 or earlier. (severity 16) in C:\webroot\test.php on line 13 Warning: MS SQL: Query failed in C:\webroot\test.php on

[PHP-DB] re: newbie question: request & response

2002-01-30 Thread Oliver Cronk
No (not out of the box anyway) BUT the beauty of PHP is its much simpler than JSP or ASP's server.response() server.request() methods (sorry if thats not the exact syntax - I haven't done huge amounts of ASP/JSP work lately), in most cases you simply output the data (i.e. print / echo "something";

[PHP-DB] Problem in editing a record

2002-01-30 Thread Miguel A.Galván
Hi ... I´m writing a code in order to update daily activities, these activities are going to be saved in 3 daily records (depending of the schedule of workers and their session id´s). I´ve already got records registered in my DB ,but the problem comes when i´m trying to edit these records to add

RE: [PHP-DB] drop down list

2002-01-30 Thread Beau Lebens
apologies for answering such an already-over-answered question, but i feel that no-one has given a particularly *good* answer, so i'll add mine to the list. I use this function (as well as a couple others which do similar things for all form elements; // Creates an HTML select box of values. // $

Re: [PHP-DB] request and response objects?

2002-01-30 Thread Paul DuBois
At 12:30 -0600 1/30/02, Matthew Crouch wrote: >basically a yes or no question my brother wants me to ask: >Does PHP support these objects? If not, Can they be faked? What, like in Java servlets/JSP pages? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTE

Re: [PHP-DB] storing and retrieving arrays in mysql

2002-01-30 Thread Corey Eiseman
Hi, thanks for the suggestions. Peter, I definitely think your second solution, the one you said you are probably going to upgrade to, is very clean: adding another table "between" categories and subcategories that defines relationships between the two. it seems like it will be much easier to code

Re: [PHP-DB] how to reverse a hudge multidimensional array?

2002-01-30 Thread Etienne DURAND
Bonsoir chef;o) thx again for helping me In fact i think the solution you gave me isn t not much faster as the while loop i use for the moment... and the execution speed is my only problem... well in fact i think i haven t be very clear with the goal i need to get. let me detail this to you

Re: [PHP-DB] how to reverse a hudge multidimensional array?

2002-01-30 Thread DL Neil
Bon soir Etienne, Like I say, "Inverting" an array is a chore, it's far easier to invert the pointers... but if you must do it:- For loop to control the first dimension using $i For loop to control the second dimension using $j $temp = $array[ $i ][ $j ]; $array[ $i ][ $j ] = $array[ $

Re: [PHP-DB] how to reverse a hudge multidimensional array?

2002-01-30 Thread Etienne DURAND
thx a lot for your answer, in fact i only have to return one of the 15 datas, so it makes one column... anyway, i already coded a solution with a while. My question was just to know if it was possible to do it without repeating 100 times the same processing. In fact i begin to believe that i

RE: [PHP-DB] Select statement only returns 1 record

2002-01-30 Thread Rick Emery
It's worked for me. You'll note that I added a new column "id". Did you put that in your table?? What error did you get -Original Message- From: Todd Williamsen [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 30, 2002 2:18 PM To: 'Rick Emery'; [EMAIL PROTECTED] Subject: RE

RE: [PHP-DB] Select statement only returns 1 record

2002-01-30 Thread Todd Williamsen
Nope, that doesn't work -Original Message- From: Rick Emery [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 30, 2002 1:01 PM To: 'Todd Williamsen'; [EMAIL PROTECTED] Subject: RE: [PHP-DB] Select statement only returns 1 record "; while( $row = mysql_fetch_array($result) ) { $FirstN

[PHP-DB] Help needed with php and db2

2002-01-30 Thread Stephanie Workman
Good day all, I am new to php and lucky me my boss has asked me to do a 'proof of concept' with php against IBM DB2. Our DB2 database resides on an OS/390 system. I'm just trying to figure out at this point if php can actually connect to our database on the OS/390. I've read about ODBC connect

Re: [PHP-DB] Select statement only returns 1 record

2002-01-30 Thread biorn
You will need to put the option tag in a loop to get all of the records in the table. (this can go anywhere but in while loop) "; $i++; } ?> Also, without the value in the option tag, you will not be passing anything to the form. HTH Maureen Biorn Todd Williamsen <[EMAIL PROTECTED]>

RE: [PHP-DB] Select statement only returns 1 record

2002-01-30 Thread Rick Emery
"; while( $row = mysql_fetch_array($result) ) { $FirstName = $row['FirstName']; $LastName = $row['LastName']; $id=$row['id']; print "$LastName, $FirstName"; } ?> print ""; -Original Message- From: Todd Williamsen [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 30, 2002 12:45 PM To: [E

Re: [PHP-DB] Select statement only returns 1 record

2002-01-30 Thread Miles Thompson
Check the manual for the mysql_fetch_array() function, it shows you how to extract data from $result. You will use the while loop (as shown in the manual's example) to fill your combo box / selct list /drop down menu, whatever we're calling that creature today. Miles At 12:45 PM 1/30/2002 -06

[PHP-DB] Select statement only returns 1 record

2002-01-30 Thread Todd Williamsen
I am trying to get data from two columns, FirstName and Last name and displaying all the records LastName, FirstName in a drop down menu. The weird thing is that it only displays one record. I thought the table was hosed, but its not. I tried it through another database and still doesn't work.

[PHP-DB] newbie question: request & response

2002-01-30 Thread Luke Crouch
Does PHP have built-in support for using request and response objects? Thanks, -L -- 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] request and response objects?

2002-01-30 Thread Razorfish
see PHP's support of cURL / libcurl. it's do-able. > basically a yes or no question my brother wants me to ask: > Does PHP support these objects? If not, Can they be faked? > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For add

[PHP-DB] request and response objects?

2002-01-30 Thread Matthew Crouch
basically a yes or no question my brother wants me to ask: Does PHP support these objects? If not, Can they be faked? -- 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 administrator

Re: [PHP-DB] MySQL Connection Class

2002-01-30 Thread jas
Yes it does, thanks... now that I have a better understanding of classes now I just need to write one. Thanks again. jas "Gurhan Ozen" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Jas, > I can't know whether or not that's right for you. It all depends on wha

RE: [PHP-DB] MySQL Connection Class

2002-01-30 Thread Gurhan Ozen
Jas, I can't know whether or not that's right for you. It all depends on what you need to do.. If you only have one database connection with one userid/pass combination, then yes it might be the solution you are looking for. But if you want to be able to reuse your code for different types of dat

Re: [PHP-DB] MySQL Connection Class

2002-01-30 Thread jas
Ok just to clear it up... our server is not running php4 unfortunately. =) "Dave Richardson" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > A number of connection classes and abstraction toolkits already exist. Your > PHP 4.x install probably came with PEAR's

Re: [PHP-DB] MySQL Connection Class

2002-01-30 Thread Dave Richardson
A number of connection classes and abstraction toolkits already exist. Your PHP 4.x install probably came with PEAR's DB.php abstraction layer. Save yourself the trouble perhaps? jas said: > So all I would need to do is create a file named db_connection.php3 and > put in the functions $

Re: [PHP-DB] MySQL Connection Class

2002-01-30 Thread jas
So all I would need to do is create a file named db_connection.php3 and put in the functions $db = mysql_connection("localhost","username","password") or die("could not connect"); and then put an include statement on the top of each page that needs the db connectiong? Please correct me if I am wr

RE: [PHP-DB] MySQL Connection Class

2002-01-30 Thread Gurhan Ozen
Are you trying to write classes to connect to the database using PHP's native DB connection functions?? If yes, you should only check those database functions' tutorials and just use them inside your class.. Gurhan -Original Message- From: jas [mailto:[EMAIL PROTECTED]] Sent: Wednesday,

[PHP-DB] Re: Date operations.

2002-01-30 Thread Frank Flynn
Gary, You have a right to be confused - this problem is short but it is about as complex as they get. Still I have a solution for you, also short and you'll (hopefully) find it elegant. I found it interesting... The thing is we will create a Cartesian product on purpose - this is something the

[PHP-DB] MySQL Connection Class

2002-01-30 Thread jas
I know this may seem a little vague but I would like to know where a good tutorial on creating database connection class files would be. I have been looking and as of yet I have not found one that deals specifically with this question. Thanks in advance. Jas -- PHP Database Mailing List (htt

RE: [PHP-DB] same connection to access two different database?

2002-01-30 Thread Andrew Hill
Vincent, If you need to use just one connection against multiple databases, you should check out Virtuoso. Among other features it can act as a "virtual database", where you link multiple heterogenous database tables through it and then can treat them as one transparent schema from a single ODBC

RE: [PHP-DB] Drop down list

2002-01-30 Thread Rick Emery
First conect to DB $result=mysql($DBname,"SELECT * FROM table"; print ""; while( list($artist_id,$name) = mysql_fetch_array($result) ) { print "$name\n"; } print ""; -Original Message- From: Julius Dlugolinsky [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 30, 2002 8:48 AM C

RE: [PHP-DB] odbc_columns()

2002-01-30 Thread Andrew Hill
Scott, odbc_columns can take a lot of arguments, but the only one you need to pass is a connection id. It'll return a result identifier containing lots of info on your field names: $conn_id = odbc_connect($dsn, $usr, $pwd) or die (odbc_error()); $result_id = odbc_columns($conn_id) or die (odbc_e

RE: [PHP-DB] Drop down list

2002-01-30 Thread Julius Dlugolinsky
First conect to DB $result=mysql($DBname,"SELECT * FROM table where 1"); $no=mysql_numrows($result); $i=0; $string=""; while ($i<$no){ $string.="".mysql_result($result,$i,"artist").""; $i++;} $string="$string"; and in string is drop down menu. EXO (www.exo.sk) > > -Original Mess

[PHP-DB] Connect to DB2-win2k through PHP4-Linux

2002-01-30 Thread Jerry
Hi, I have a windows 2000 Database Server with IBM DB2 V7.2 on it. I have a Web Server with Linux-Apache-PHP 4 on it (but not XWindow or any graphical interface...). On the web server, I want to run a PHP page to connect to the IBM DB2 Database on the win2k server. 1.> Do I need to install DB2

RE: [PHP-DB] Drop down list

2002-01-30 Thread Niklas Lampén
I'm not allowed to answer arguments pointed to me? This is my way of dealing with newbies, and this is what I've learned to be the most powerfull way to really learn how to do things. If you don't like it - fine - handle them how you like. Niklas -Original Message- From: Piotrek [mailt

Re: [PHP-DB] Drop down list

2002-01-30 Thread Piotrek
OK. Someone else has already answered the question, so you could shut up and stop teaching us all how to deal with newbies. This way you'll help "in a way" - Original Message - From: "Niklas Lampén" <[EMAIL PROTECTED]> To: "Php-DB" <[EMAIL PROTECTED]> Sent: Wednesday, January 30, 2002

RE: [PHP-DB] Drop down list

2002-01-30 Thread Niklas Lampén
Well, true. :) There is a but: I think it's stupid to try to get the solution from others while the information is very easy to find by reading the manual. This issue is about _very_ basic stuff. If you do not know how to loop your query result, what in earth can you do with it? This is my point,

Re: [PHP-DB] Date operations.

2002-01-30 Thread DL Neil
Garry, > > > CREATE TABLE breeding ( > > > rec SMALLINT(4) UNSIGNED AUTO_INCREMENT, > > > sire SMALLINT(4) UNSIGNED, > > > dam SMALLINT(4) UNSIGNED, > > > paired DATE, > > > split DATE, > > > num_offspring TINYINT(1) ZEROFILL, > > > PRIMARY KEY (rec) > > > ); > > > > > > First, we d

Fw: [PHP-DB] Drop down list

2002-01-30 Thread George Lioumis
- Original Message - From: George Lioumis To: B.J.Rumsey Sent: Wednesday, January 30, 2002 11:47 AM Subject: Re: [PHP-DB] Drop down list Try the following: "; $res = mysql_query($get_list) or die (mysql_error()); while ($row = mysql_fetch_array($res)) { $artid= $row["artist_id"]; $a

Re: [PHP-DB] RE: ensuring unique field value in MySQL using PHP

2002-01-30 Thread Michael Waples
Dl Neil wrote: > > Janet, > > MySQL (and indeed all multi-user databases) has a feature called "Locking". What >this means is that whilst many > users/clients may access a database, apparently simultaneously, when one (or more) >is updating the data in some > way, everyone else is kept locked-

Re: [PHP-DB] how to reverse a hudge multidimensional array?

2002-01-30 Thread DL Neil
Etienne, > Well i hope someone will be able to give me a solution... > Here s my problem: > I'm working with a hudge mysql table (about 15 columns and 100 rows...) > > in fact i ve got to count the number of couples `ncompte`/`naffaire` in the > table and finaly calculate the number of coupl

RE: [PHP-DB] Drop down list

2002-01-30 Thread Niklas Lampén
1. Do query 2. Loop thru query results and write HTML for dropdown I think you should know atleast the basics of SQL + HTML before asking stuff here. There are whole lot of tutorials around the net. Niklas -Original Message- From: B.J.Rumsey [mailto:[EMAIL PROTECTED]] Sent: 30. tammi

[PHP-DB] Drop down list

2002-01-30 Thread B.J.Rumsey
  I have two fields artist_id, artist. How do I put the contents of "artist" into a dropdown list.   IncrediMail - Email has finally evolved - Click Here