[PHP-DB] rownum in mysql

2001-05-17 Thread andrie
is mysql has reserve word like 'rownum' in oracle ? wassalam, andRie -- 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] Pick a row, any row.

2001-05-17 Thread Gary Huntress
the syntax "order by rand()" is new in version 3.23 -- Regards, Gary "SuperID" Huntress === FreeSQL.org offering free database hosting to developers Visit http://www.freesql.org ""Johannes Janson"" <[EMAIL PROTECTED]> wrote in message 9e11f0

Re: [PHP-DB] Random - not that random

2001-05-17 Thread Ken Wills
Hi Dan, You need to call mt_srand() first to seed the random number generator. It's all described here: http://www.php.net/manual/en/function.mt-rand.php Ken * Dan Eskildsen <[EMAIL PROTECTED]> [010517 14:22]: > Newbie alert > > Hi! Here is a piece of coding. It randomly ch

[PHP-DB] Random - not that random

2001-05-17 Thread Dan Eskildsen
Newbie alert Hi! Here is a piece of coding. It randomly choose between four options to display on my homepage. The problem is that it doesn't seem to be that random - rather biased. The last option $message[3] is displayed 9 out of 10 times. Any suggestions? $message[0] = 'Re: [PHP-DB] Storing duplicate checkbox values
I got around it by using a "standard" naming scheme. (This will work if you have LESS than $num_items, but not more. If you have LESS, then it'll just hit the "not set" while loop more.) Oh, ignore the They're just there to keep Win-based systems from trying to interpret the code. $num_item

Re: [PHP-DB] Pick a row, any row.

Hi, > How can I pick a random row? SELECT * FROM table ORDER BY RAND() LIMIT 0, 1; I'm not really sure but it worked with order by rand. Check the manual on that if it doesn't work hope it helps Johannes -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTE

[PHP-DB] displaying multiple results only one time...

Ok, I've fifured a few possible solutions that seem really inefficient, but I'm wondering if anyone else has a better idea... running php/mysql while displaying product in a store site you click on a category, this brings up a page of manufacturers of stuff in the category as well as a link t

[PHP-DB] New: MLM SURVEY RESULTS

Choose From Any Of The Following: Promote your Existing Business Or Make Money With One Of Our! Choose From The 2 Below If You Have An Existing Business Choice 1: GUARANTEEd ... 1,000,000 Banner IMPRESSIONS!! FIND OUT WHAT THE PROS HAVE BEEN DOING FOR YEARS!! NOW AVAILABLE TO EVERYONE!! Promote

[PHP-DB] SELECT question

Nick, Use the group by function: SELECT items.itemId, description, link, sum(qty) AS total_qty, sum(price) AS total_price FROM carts, items WHERE carts.custId = '$custId' AND items.itemId = carts.itemId GROUP BY items.itemId, description, link You'll have to change the reference to the followi

Re: [PHP-DB] SELECT question

If you have a shopping cart why would you want them to add the same item in there twice... why not just have them update their quantity to 5? At 11:10 PM 5/16/01, you wrote: >>Hi All, >> >>I'm building a standard shopping cart style e-commerce site using PHP and >>MySQL running on Apache. >

Re: [PHP-DB] SELECT question

>Hi All, > >I'm building a standard shopping cart style e-commerce site using >PHP and MySQL running on Apache. > >I store my users' cart info in this table: > >++--+--+-+-+---+ | >| Field | Type | Null | Key | Default | Extra | + >+---

[PHP-DB] php4.0.5 causes seg faults with mysql 3.23.38

I upgraded to mysql 3.23.38 and recompiled apache 1.3.19 with php 4.0.5. Now I am getting the following in my apache error_log file: [Thu May 17 09:41:42 2001] [notice] child pid 25756 exit signal Segmentation fault (11) and the following in my mysql hostname.err file: 010517 9:39:03 Aborted

RE: [PHP-DB] MySQL Connect Problem

I tried your code and got this: Warning: Can't connect to MySQL server on 'localhost' Also tried ip address of my machine. So at least maybe that narrows down the problem. Jeff Oien > Hi Jeff, > I am using Windows, but am a beginner. Here is some code I use maybe it > will help > > I use thi

RE: [PHP-DB] MySQL Connect Problem

Hi Jeff, I am using Windows, but am a beginner. Here is some code I use maybe it will help I use this in my navigation pages: and here is db_details.php By using the include it means if I go LIVE with a site I only have to change one file db_details.php The reason I don't do it all in one

RE: [PHP-DB] MySQL Connect Problem

I'm on Windows 2000. Jeff > Jeff, > > If you are on unix/linux use the command id to see who you are. > You can only use jeff in your connect string if jeff is a user in your mysql > database. > > If you are root when you are running mysql then you should probably set a > password for root i

[PHP-DB] Pick a row, any row.

Newbie alert! Hi. Just a qucik question: Does anyone know of a random function that I can use. I want to query my database. Then random pick one of the rows in the result, and then display the contents of the randomly picked row. How can I pick a random row? Thank you in advance. --

RE: [PHP-DB] function login problem

Hi Greg, I can't C a call 2 Ur function login() in the below code-snipplet ... perhaps that's the clue ?? Greetinx, Mike Michael Rudel - Web-Development, Systemadministration - ___ Suchtreffer AG Bleicherstraße 20 D-78467 Konstanz G

[PHP-DB] function login problem

I am creating a function called login, I have a main file called index.php .. which has my login form , it calls a login.php file, and in that login.php there is file include statement which calls config.php and that is where the function lie. This is my function , now if i don't set this as a fun

[PHP-DB] Removing Characters

hi, i have a string and i want to remove certain characters from it. i would like to remove the characters ~!@#$%^&*()_+|{}:"<>?-=\[];'./,` i would like to also remove html tags like  , &, ©, etc. Thanks _ Get Your Priva

RE: [PHP-DB] Filling mysql db with access db

Sorry for the late answer, but better too late than never =8) OK, there's a tool named access2mysql (but only on Unix). I think U can get it @ the mysql-web site. Hope this helps. Greetinx, Mike Michael Rudel - Web-Development, Systemadministration - _

Re: [PHP-DB] Update Multiple records

I think , You should do following : update weld_details set parent = '1' where db_uid = '1' or db_uid = '2' Ben Cairns wrote: > I want to update a MySQL db table, but I want to update multiple records, > > Like this: > > I want to run a statement like this: > update weld_details set parent = '

RE: [PHP-DB] Detect OS

> $HTTP_USER_AGENT (if you're using Apache with PHP) should do > what you need. ¥es, but not 100%, because there R thousands of different User-Agents out there, and the User-Agent of many browsers R customizable or Proxy's which R filtering them out. I think that U can use the $HTTP_USER_AGENT i

RE: [PHP-DB] Update Multiple records

Hi Ben, I think U can use: [...] where db_uid = '1' or db_uid = '2' ... OR [...] where db_uid in ('1', '2', ...) Hope this helps. Greetinx, Mike Michael Rudel - Web-Development, Systemadministration - ___ Suchtreffer AG Bleicher

RE: [PHP-DB] export

hi, maybe a better way to do it would be to use tempnam $fname=tempnam("/www/htdocs/edb/tmp","CSV"); $fp= fopen($fname,"w+"); $filename=basename($fname); create a var with todays dats in it and then set that as the second parameter of tempnam. this will generate unique filenames including the d

[PHP-DB] Update Multiple records

I want to update a MySQL db table, but I want to update multiple records, Like this: I want to run a statement like this: update weld_details set parent = '1' where db_uid = '1','2' Now, it dont work, and I cant see why, I think it has something to do with the numbers at the end of the stateme