$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
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://
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
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";
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
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.
// $
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
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
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
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[ $
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
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
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
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
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]>
";
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
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
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.
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]
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
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
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
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
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
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 $
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
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,
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
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
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
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
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
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
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
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
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
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,
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
- 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
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-
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
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
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
43 matches
Mail list logo