Re: [PHP-DB] mysql_num_rows

2002-09-19 Thread 1LT John W. Holmes
I'm getting a strange error message from calling this function It spits out Unknown column 'Resource' in 'field List' This is my query: SELECT dept.name, count(maintenance.deptid)/$total AS percentage FROM maintenance JOIN dept WHERE maintenance.deptid=dept.deptid GROUP BY dept.name

Re: [PHP-DB] set_magic_quotes_runtime???

2002-09-19 Thread 1LT John W. Holmes
So what does set_magic_quotes_runtime(0) do then??? Will it shut off the automatic backslashing of single quotes at run time or not? (it certainly doesn't seem to) It will turn off the escaping of quotes from data your script reads while it's executing, namely from data returned from a

Re: [PHP-DB] magic_quotes_gpc?

2002-09-19 Thread 1LT John W. Holmes
New PHP (long time PERL user) here. I am using an Access database - yeah I know Access is crap, but I have no choice. Anyway, it seems that this magic backslash thing is unavoidable. As I understand it, I can shut it off at the .ini level, but I am running this app on a hosted server with

Re: [PHP-DB] how can I do?

2002-09-19 Thread 1LT John W. Holmes
Or this works well too and might be faster for the DB. SELECT * FROM SomeTable WHERE create_date BETWEEN $start_date AND $end_date Benchmark it yourself, but I've found that BETWEEN is slower. It's easier to read, though. ---John Holmes... -- PHP Database Mailing List

Re: [PHP-DB] how can I do?

2002-09-19 Thread 1LT John W. Holmes
I am trying to find the records whose create dates (field name =create_date) are between the ones I want .For example , I want to seee the records between $start_date and $end_date ..So I tried the code below..But it looks not that right to me?... select * from bug where .. and

Re: [PHP-DB] advise needed for 'authorized only' site

2002-09-23 Thread 1LT John W. Holmes
I have set up a section of my company site for use by authorized dealers only. I am currently using mysql authorization, which works for the first page, but if someone were to type in the url of an underlying page they would be able to get in without authorization. I know I could use

Re: AW: [PHP-DB] getting mysql_fetch_row into array

2002-09-23 Thread 1LT John W. Holmes
$res = mysql_query (SELECT COUNT(deptid) FROM maintenance GROUP BY deptid); $deptcount = array(); // reset the array while ($row = mysql_fetch_row ($res)) { $deptcount[] = $row[0]; this should be $deptcount[] .= $row[0]; shouldn't it? No. The way it's written is it's adding an

Re: [PHP-DB] advise needed for 'authorized only' site

2002-09-23 Thread 1LT John W. Holmes
Why do you need the secret variable? If your server is set up correctly, the user can't create any session variables, all they can do is create a session ID. So you could just check for a user-id and you'd be good. ---John Holmes... - Original Message - From: Jackson Miller [EMAIL

Re: [PHP-DB] Return Array from Function

2002-09-26 Thread 1LT John W. Holmes
You can't start variables with a number. ---John Holmes... - Original Message - From: Hutchins, Richard [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, September 26, 2002 4:18 PM Subject: [PHP-DB] Return Array from Function Can somebody tell me what I might be doing wrong in

RE: [PHP-DB] query fails with mysql_query but success with direct SQL from command line

2002-09-26 Thread John W. Holmes
How do you know if fails? What does mysql_error() say? ---John Holmes... -Original Message- From: Thoenen, Peter Mr. EPS [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 26, 2002 10:13 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] query fails with mysql_query but success with

RE: [PHP-DB] Random numbers with range in mysql?

2002-09-28 Thread John W. Holmes
I'm trying to make shops that sell virtual objects. They restock once every 15 minutes. This is all set up. The problem is, I would like to have objects in these shops with a random chance of being restocked. My idea is to store two numbers in the restock list: chance, and outof. (For a

RE: [PHP-DB] Very cool -= Code Generator =- !!!

2002-09-29 Thread John W. Holmes
Use Codejay as your web assistant. Create ASP , PHP, COLDFUSION , ASP.NET web applications Save time and money. Visit www.codejay.com Interesting program, did anyone else check it out?? All it really does is generate reports and create admin interfaces to add/edit data in a database. The

RE: [PHP-DB] Next N Interface

2002-09-30 Thread John W. Holmes
That would actually work for just getting a certain number of records from a query, but you would have to execute another query to figure out the navigational links he said he wants on the bottom...like google has, 1 2 3 4 5 . So, when I attacked it I figured one query is better then two

RE: [PHP-DB] Compare time functions

2002-09-30 Thread John W. Holmes
Could anyone help me to figure out how to write a piece of code that says if the time now time( ) is greater than 1 hour of the time( time stored in the database) do something. I have a script that gets the time as of now and I also have the time of (lets say then) stored in a database.

RE: [PHP-DB] enum and bad planning

2002-10-01 Thread John W. Holmes
I have five enum fields, all Y/N. There is now(last minute) a requirment to report on all clients that said Y to more then one of the questions(its a survey). Had i known about this requirement, i could have made them BIT and had a simple 1/0 option and summed the fields to check the

RE: [PHP-DB] enum and bad planning

2002-10-01 Thread John W. Holmes
. John W. Holmes holmes072000@ch To: [EMAIL PROTECTED], [EMAIL PROTECTED] arter.net cc: Subject: RE: [PHP-DB] enum and bad planning 10/01/2002 03:19

RE: [PHP-DB] enum and bad planning

2002-10-01 Thread John W. Holmes
At 03:35 PM 10/1/02 -0400, John W. Holmes wrote: You should BENCHMARK the two solutions and see which is faster. Or use EXPLAIN to see if there is any difference. I have no doubt this will be slower. Oh well, he wanted to keep the table definitions. Don't forget to consider the time

RE: [PHP-DB] PhpHoo_create database phpHoo\p\g

2002-10-01 Thread John W. Holmes
PostGreSQL? ^ ^ ---John Holmes... -Original Message- From: Russell Griechen [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 01, 2002 7:50 PM To: Php-Db Subject: [PHP-DB] PhpHoo_create database phpHoo\p\g I was looking at PhpHoo 'yahoo-like directory' What is the \p\g

RE: [PHP-DB] PHP, dates, and MySQL data comparisons

2002-10-01 Thread John W. Holmes
I have a table with a Date field (-mm-dd) and I would like to retrieve all rows with the date less than one week ago. Something like SELECT FROM table WHERE date one_week_ago_today. SELECT * FROM table WHERE date NOW() - INTERVAL 7 DAY; ---John Holmes... -- PHP Database

RE: [PHP-DB] Retrieve auto_increment value after an insert with ODBC

2002-10-02 Thread John W. Holmes
This is not a safe way to do it unless you are locking the table, getting max value, doing insert with value retrieved, and then unlocking table. Reason being is that two scripts (or more) running at the same time can retrieve the same max() value and try to insert it. ---John Holmes...

RE: [PHP-DB] Difference in time

2002-10-02 Thread John W. Holmes
I am fighting a time issue(don't we all). I have a online poll set up. I need a way to stop a person from submitting more than once an hour. As of now I have the time .. mktime( ) .. being stored in a database along with the users IP. I want to be able to say if 1 hour has passed from the

RE: [PHP-DB] MySQL 4.x and PHP

2002-10-02 Thread John W. Holmes
New MySQL is out I noticed (4.0.4). Is there any way to make it work correctly with PHP? I haven't seen any modules for download or comments about this issue. I'm just wondering if there is some modifications I can make or if I'm just stuck with MySQL 3.x until something new is released

Re: [PHP-DB] Table question....

2002-10-03 Thread 1LT John W. Holmes
$bgcolor = ($count++ 1) ? blue : black; Then use $bgcolor in your tr ---John Holmes... - Original Message - From: Rodrigo [EMAIL PROTECTED] To: PHP [EMAIL PROTECTED] Sent: Thursday, October 03, 2002 8:29 AM Subject: [PHP-DB] Table question Hi people, is there a way to print a

Re: [PHP-DB] Showing multiple option list from db query?

2002-10-03 Thread 1LT John W. Holmes
I have a database (mysql) that has some rows entered. Format: Name | Desription | catid This has some info in it like this Joe Man 1 Jack Man 1 Jacky Female 2 Emily Female 2 What I am trying to do is create dynamically created select lists so that all with catid 1 are in the fisrt

RE: [PHP-DB] Pulling apart select list elements

2002-10-03 Thread John W. Holmes
I have a select multiple/select object named list[] that is passing its selected contents to an array. That part works fine. I can use a for loop to grab all of the selected items. Where I'm stuck is that I want to get both the value AND the text for any given option element and simply

RE: [PHP-DB] Function help....

2002-10-03 Thread John W. Holmes
Sprintf() or printf() would be better... ---John Holmes... -Original Message- From: Rodrigo [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 03, 2002 1:41 PM To: PHP Subject: [PHP-DB] Function help Hi people, i wanna know from you if this is the way to complete a filed

RE: [PHP-DB] passing array to next page

2002-10-06 Thread John W. Holmes
Look at the serialize() function or use sessions. www.php.net/serialize ---John Holmes... -Original Message- From: Smita Manohar [mailto:[EMAIL PROTECTED]] Sent: Sunday, October 06, 2002 6:33 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] passing array to next page hello all, im

RE: [PHP-DB] Some data manipulation

2002-10-06 Thread John W. Holmes
Write a function to do whatever you want to each element, then use array_walk(). ---John Holmes... -Original Message- From: Hatem Ben [mailto:[EMAIL PROTECTED]] Sent: Saturday, October 05, 2002 6:49 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Some data manipulation hey all i

RE: [PHP-DB] possible Error in Querydefiniton

2002-10-06 Thread John W. Holmes
You can find out why with mysql_error(), but it's probably because you haven't selected a database with mysql_select_db(). ---John Holmes... -Original Message- From: root@linux [mailto:root@linux] On Behalf Of Ruprecht Helms Sent: Sunday, October 06, 2002 3:25 PM To: [EMAIL

RE: [PHP-DB] Noob error question

2002-10-06 Thread John W. Holmes
Is this on a live site, or one with just this test script running? You may be running into the max_connections of mysql. You're not connecting for _every_ query on the page, are you? You should have just one connect at the beginning, do all of your queries, then close at the end of the script.

RE: [PHP-DB] possible Error in Querydefiniton

2002-10-07 Thread John W. Holmes
Use mysql_error() in your die() message to find out what the problem was... ---John Holmes... -Original Message- From: root@linux [mailto:root@linux] On Behalf Of Ruprecht Helms Sent: Monday, October 07, 2002 4:17 AM To: John W. Holmes Cc: [EMAIL PROTECTED] Subject: RE: [PHP-DB

Re: [PHP-DB] results of query

2002-10-07 Thread 1LT John W. Holmes
What does everyone typically use to display the results of a query. For example, I have a database that has a series of subjects and grades. If I select * from the table, I want a nice way for the data to be displayed. In cold fusion, I can simply use a grid that dynamically fills in. Can

RE: [PHP-DB] Auto Increment

2002-10-07 Thread John W. Holmes
CREATE TABLE table_name (ID INT NOT NULL AUTO_INCREMENT = 1 PRIMARY KEY, ... ); ---John Holmes... -Original Message- From: Gavin Nouwens [mailto:[EMAIL PROTECTED]] Sent: Monday, October 07, 2002 9:50 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Auto Increment Hi peoples,

Re: [PHP-DB] need help

2002-10-08 Thread 1LT John W. Holmes
Remove all of the @ for one, so you can see if there are any errors. You're using $rs as two different variables, also. Check mysql_error() after your query to see if an error is returned. ---John Holmes... - Original Message - From: Frederick Belfon [EMAIL PROTECTED] To: [EMAIL

RE: [PHP-DB] FLAT FILE database questions.

2002-10-08 Thread John W. Holmes
How about the dbm or dbase functions in the manual? You can create flat file databases with them and possibly have a little more built in functionality that you won't have to program. I've never used them, but check the manual and see if they'll suit you needs. Chapter XVII. Database (dbm-style)

RE: [PHP-DB] Advanced search scripts

2002-10-09 Thread John W. Holmes
What database are you using? ---John Holmes... -Original Message- From: Adam Royle [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 09, 2002 2:09 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] Advanced search scripts I was wondering if anyone has some resources (links or scripts)

RE: [PHP-DB] Advanced search scripts

2002-10-09 Thread John W. Holmes
this would be database dependent (unless you have other ideas). Adam On Wednesday, October 9, 2002, at 08:46 PM, John W. Holmes wrote: What database are you using? ---John Holmes... -Original Message- From: Adam Royle [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 09

RE: [PHP-DB] Advanced search scripts

2002-10-09 Thread John W. Holmes
... -Original Message- From: John W. Holmes [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 09, 2002 7:02 AM To: 'Adam Royle' Cc: [EMAIL PROTECTED] Subject: RE: [PHP-DB] Advanced search scripts If you're looking at a PHP only solution, then you've got to build an engine that'll parse

RE: [PHP-DB] Advanced search scripts

2002-10-09 Thread John W. Holmes
-Original Message- From: John W. Holmes [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 09, 2002 7:08 AM To: 'Adam Royle' Cc: [EMAIL PROTECTED] Subject: RE: [PHP-DB] Advanced search scripts FYI about MySQL Fulltext searching. It's got everything you already want (in version

Re: [PHP-DB] DEALING WITH RETRIEVING AND WRITING DATE VALUE FROM/TO TABLE

2002-10-09 Thread 1LT John W. Holmes
I need to know how to retrieve a date field from a database table using MYSQL_DB_QUERY to create recordset. As well as writing a Date Variable to a table using MYSQL_QUERY . For one, don't use mysql_db_query(), it's depreciated. You'd use mysql_query() for both instances and

Re: [PHP-DB] Separating content from style

2002-10-09 Thread 1LT John W. Holmes
One of the most popular template engines is Smarty. Search on google for it. There are plenty of others and even some modules that can be installed into PHP for faster performance. YOu can easily seperate logic from presentation with PHP, but most people choose not to. For most simple projects

RE: [PHP-DB] Error query : mysql_result

2002-10-10 Thread John W. Holmes
This usually means your query failed. Check for errors using mysql_error(). ---John Holmes... -Original Message- From: Burgess [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 10, 2002 5:14 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] Error query : mysql_result Hi I have used

RE: [PHP-DB] Re: Multi-Table Insert and gettin' data from auto-inc coloumn in one to the other

2002-10-10 Thread John W. Holmes
No, you have to use two queries to do two inserts into different tables... ---John Holmes... -Original Message- From: Noodle Snacks [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 10, 2002 7:07 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] Re: Multi-Table Insert and gettin' data

RE: [PHP-DB] OT...where do I go for this......?

2002-10-10 Thread John W. Holmes
That would be an Apache configuration issue. Somewhere in http.conf, I think, you can choose whether or not to allow GET/POST operations. ---John Holmes... -Original Message- From: Michael Cortes [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 10, 2002 10:25 AM To: [EMAIL

RE: [PHP-DB] update and join?

2002-10-10 Thread John W. Holmes
Quick questionis it possible to do an update query w/ a join yet? If not, what is your preferred method? Would you take care of it on the PHP side? Probably depends on your database, but MySQL doesn't support it. I think MySQL 4.0 might. I need to update a table w/ data from another

RE: [PHP-DB] Selecting PASSWORD() value in MySQL

2002-10-10 Thread John W. Holmes
I'm trying to retrieve data from a MySQL table which contains data encrypted with the MySQL PASSWORD() function from a PHP script but I can't seem to get it to work. Below is the query I'm trying: SELECT * FROM user_data WHERE username = 'thaak' AND password = PASSWORD('thaak'); I then

RE: [PHP-DB] Selecting PASSWORD() value in MySQL

2002-10-11 Thread John W. Holmes
15). The stored string's end was concatenated. I found that in my example it made the string 4 times as long. Thanks! Tim Haak -Original Message- From: John W. Holmes [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 10, 2002 7:17 PM To: Tim Haak; [EMAIL PROTECTED] Subject

RE: [PHP-DB] easier way to do this? (time interval)

2002-10-11 Thread John W. Holmes
if(date(H)7)) { $var1 = 1; $var2 = 0; } else { $var1 = 0; $var2 = 1; } Then use this query: SELECT dtg FROM techs WHERE tech='$user' AND (TO_DAYS(dtg) = TO_DAYS(CURRENT_DATE) - $var1 DAY AND HOUR(dtg) 7) AND (TO_DAYS(dtg) = TO_DAYS(CURRENT_DATE) + $var2 DAY AND HOUR(dtg) 7) I _think_

RE: [PHP-DB] easier way to do this? (time interval)

2002-10-11 Thread John W. Holmes
I don't think this would work. You're asking for rows where the date is greater than 24 hours ago, and the hour is greater than seven. So, if it's 8 am in the morning, you'll get results from 8 am yesterday until midnight, then from 7 am today until 8 am today. You'll miss the rows from midnight

RE: [PHP-DB] Array Initialization

2002-10-13 Thread John W. Holmes
$newInfo[$stripped] = $value; ---John Holmes... -Original Message- From: Rich Hutchins [mailto:[EMAIL PROTECTED]] Sent: Sunday, October 13, 2002 3:42 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Array Initialization Please forgive me ahead of time, but I didn't want to subscribe

RE: [PHP-DB] Accessing data from next row? (mysql)

2002-10-14 Thread John W. Holmes
Using mysql, how do I access the data of the next row using code something like this: $result = mysql_query(select column from table where whatever='whatever'); while($array = mysql_fetch_array($result)){ //Whatever } Each iteration of the while loop will fetch a row for you and it's

RE: [PHP-DB] Accessing data from next row? (mysql)

2002-10-14 Thread John W. Holmes
the loop is in row 2, but still have the loop go to row 3 when it's done with row 2? John W. Holmes wrote: Using mysql, how do I access the data of the next row using code something like this: $result = mysql_query(select column from table where whatever='whatever'); while($array

RE: [PHP-DB] (reverse) matching like LIKE?

2002-10-14 Thread John W. Holmes
When if have the keyword 'msq' i can match the field 'mysqldata' SELECT * FROM table WHERE field LIKE $keyword% But how do i get a match when the keyword is 'mysqldatabase' and the field 'mysql'? (TRUE cause keyword contains 'mysql'). That'll never work unless you know where to divide up

RE: [PHP-DB] .htaccess and db authentication

2002-10-14 Thread John W. Holmes
Store the files outside of your web root or in an .htaccess protected directory. You don't have to control an .htaccess password list, just let PHP handle the sending of the file. Validate your user and whether they should be looking at the file they requested, then use header() to send the

RE: [PHP-DB] Birthdays!

2002-10-14 Thread John W. Holmes
There has to be a better way than this, but this is what I came up with before dinner... $dayofyear = date(z); $daysinyear = (date(L))?366:365; $numover = ($dayofyear + 14) - $daysinyear if($numover 0) { $sql = DAYOFYEAR(dob) $numover AND ; $twoweeks = $daysinyear; } else {

RE: [PHP-DB] Re: file upload and php (Not a begginer question!)

2002-10-15 Thread John W. Holmes
If you don't want to use HTML, then you'll have to use a Java, C/C++, etc... type program... ---John Holmes... -Original Message- From: BAROILLER [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 15, 2002 4:12 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Re: file upload and php (Not

RE: [PHP-DB] hotlink MySQL

2002-10-15 Thread John W. Holmes
Is it possible to hotlink a MySQL database? my site location is different then my MySQL location. (or at least a site). Is it possible to use the database for both sites or should I set up the database at both locations? The reason for asking is that one of the locations doesn't provide

Re: [PHP-DB] Getting valie between two fields? (mysql)

2002-10-16 Thread 1LT John W. Holmes
I have a table something like this: __ | id | number | | 1 | 1 | | 2 | 23| | 3 | 59| | 4 | 103 | If I have a number, say 30, I need to get the last number it's above - in this case id 2. Any ideas? $number = 30; SELECT id FROM table WHERE

Re: [PHP-DB] Print data

2002-10-23 Thread 1LT John W. Holmes
hello, at my company we have several network printers and i was was wondering if it's possible to print directly to them using PHP, instead of showing on the screen or both ... to gain more control on what is printed, because of the nasty browsers header and footer ... whom i now how to

Re: [PHP-DB] Function that outputs at line xxx

2002-10-23 Thread 1LT John W. Holmes
__LINE__ and __FILE__ should work. ---John Holmes... - Original Message - From: Peter Beckman [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, October 23, 2002 3:00 PM Subject: [PHP-DB] Function that outputs at line xxx Hey -- I'm writing a database error handler function in

Re: [PHP-DB] Function that outputs at line xxx

2002-10-23 Thread 1LT John W. Holmes
Beckman [EMAIL PROTECTED] To: 1LT John W. Holmes [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, October 23, 2002 3:26 PM Subject: Re: [PHP-DB] Function that outputs at line xxx John, that does work! Thanks. The problem is this: Database calls are in db.inc. The script problem occurs

Re: [PHP-DB] Credit Card Info Cryptography

2002-10-23 Thread 1LT John W. Holmes
When ever I see easy, encrypt, and credit card in the same sentence, it makes me worry. Don't store credit card numbers. Charge them once and don't save it anywhere. ---John Holmes... - Original Message - From: Ryan Jameson (USA) [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday,

Re: [PHP-DB] Credit Card Info Cryptography

2002-10-23 Thread 1LT John W. Holmes
need to implement it. Thery is wonderful, however, practicle must preside. Hmmm, that's funny. I would think that _security_ must preside. Maybe I run a different business than you do. ---John Holmes... -Original Message- From: 1LT John W. Holmes [mailto:holmes072000;charter.net] Sent

RE: [PHP-DB] Adding 1 day to date/datetime/timestamp?

2002-10-23 Thread John W. Holmes
I need to add one day to a datetime/date/timestamp field. How would I do this? (sorry for the n00b-ish question...) I'm using mysql. SELECT your_column + INTERVAL 1 DAY FROM your_table; ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP-DB] Manioulating a Flat File

2002-10-18 Thread 1LT John W. Holmes
Here's what I'd like to know: Is there a PHP function for easily finding and removing a line from a flat file of data. And, if not, is there a way to remove a line (or lines) after finding them using fget()? Easy way to do this is with file(). It'll read the entire file into an array, with each

RE: [PHP-DB] Automattic Rollback on User Cancel with MySQL

2002-10-18 Thread John W. Holmes
I Am using the latest PHP version 4.2.3 with MySQL 3.23.51-max. I use InnoDB tables for transactions and everything works fine with Rollback and Commit. But when the user presses cancel in the browser or the script stops due to an error in the script all open transactions are committed

RE: [PHP-DB] It counts everything not a specific day..

2002-10-19 Thread John W. Holmes
Well, for one thing, EXTRACT() is for MySQL timestamps, not unix timestamps. ---John Holmes... -Original Message- From: Noodle Snacks [mailto:webmaster;tececo.com] Sent: Saturday, October 19, 2002 7:36 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] It counts everything not a specific

RE: [PHP-DB] Forms question..

2002-10-20 Thread John W. Holmes
When I have an input form I must click on the first input field. Is there anyway to have it active when the form loads? Javascript, not PHP. Something like document.form.element.setfocus(), I think. #2 When I tab down to the next input field, is there anyway to have it highlight what is in

RE: [PHP-DB] MySql and displaying only yesterday's records

2002-10-21 Thread John W. Holmes
Given a datetime field in a MySql database, how can i list all the records that are dated back to yesterday or to 'N' days in the past? SELECT * FROM your_table WHERE TO_DAYS(date_column) = TO_DAYS(CURRENT_DATE) - N Where N is how many days you want to go back. ---John Holmes... -- PHP

Re: [PHP-DB] Millions of records in MySQL

2002-10-25 Thread 1LT John W. Holmes
I remember ages ago that mysql does not properly handle upwards of 10 million records in a table? What's this got to do with PHP? And yes, MySQL will handle it, depending on what you're doing with the data. There are always alternatives, though. ---John Holmes... -- PHP Database

[PHP-DB] RE: [PHP] Enum table entry

2002-10-19 Thread John W. Holmes
There should really be another table for all of this information. Say you're tracking school information for a specific person. That person would have an ID number and you'd store the school information in a separate table that stores the user's ID and the school ID. You could even expand this to

[PHP-DB] Re: [PHP] RE: [PHP-DB] Broken Links 2

2002-10-24 Thread 1LT John W. Holmes
You might want to check out netpbm. I've seen that it makes better quality thumbnails. Plus, you can include it in your package (if appropriate) and people that don't have GD installed can use it. ---John Holmes... - Original Message - From: Rankin, Randy [EMAIL PROTECTED] To: [EMAIL

RE: [PHP-DB] MySQL Insert Select statement

2002-10-19 Thread John W. Holmes
That's how you do it. Hopefully you've figured it out already. ---John Holmes. -Original Message- From: dwalker [mailto:dwalker;healthyproductsplus.com] Sent: Saturday, October 19, 2002 7:51 PM To: professional php; [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: [PHP-DB] MySQL

RE: [PHP-DB] localhost versus remote

2002-10-27 Thread John W. Holmes
Hi everyone, I'm using a MySQL DB and a search form. Eveery thing works fine, but when I upload, it has a Error in query. I checked all the little details but can't find out why? Any ideas are welcome. Jacco This one is an easy problem to fix. All you have to do is find the error and

RE: [PHP-DB] Getting rows where column has changed?

2002-10-27 Thread John W. Holmes
I'm trying to make a page to help in detecting people using automatic refresher programs. In the table that stores user info, there is a column called lastseen which says when the user was last seen. I'm trying to: 1. Select all lastseen colmns that are less than 5 minutes old 2. Wait 2

RE: [PHP-DB] mysql_errno?

2002-10-27 Thread John W. Holmes
I just looked at the function mysql_errno, where it says that mysql_*-functions don't issue warnings anymore and that you have to check for errors yourself... That's what I also want but is, for example, the database is not reachable on a call to mysql_connect, the function still triggers a

RE: [PHP-DB] localhost versus remote

2002-10-27 Thread John W. Holmes
MySQL Error: You have an error in your SQL syntax near 'Field2 LIKE '%%' Field3 LIKE '%%' ORDER BY ' at line 2 SQL: SELECT * FROM airline_a WHERE Field1 LIKE '%%' Field2 LIKE '%%' Field3 LIKE '%%' ORDER BY You need some ANDs between each of your field LIKE '%%' clauses. WHERE field1 LIKE

Re: [PHP-DB] Converting database from MS Access to MySQL on Linux

2002-10-29 Thread 1LT John W. Holmes
Can u pls help in Converting database from MS Access to MySQL on Linux. Pls send the code for converting. http://www.google.com/search?hl=enie=UTF-8oe=UTF-8q=Converting+database+f rom+MS+Access+to+MySQL+on+Linux ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To

Re: [PHP-DB] fetching image by url and storing in mysql

2002-10-29 Thread 1LT John W. Holmes
You don't need filesize(). $fp = fopen('address_to_image','r'); while(!feof($fp)) { $image .= fread($fp,1); } Something like that will work... ---John Holmes... - Original Message - From: Marcus Fleige [EMAIL PROTECTED] To: PHP-Mailinglist [EMAIL PROTECTED] Sent: Tuesday, October

Re: [PHP-DB] Retruning an array from a row

2002-10-30 Thread 1LT John W. Holmes
- Original Message - From: Erick Wellem [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, October 30, 2002 6:44 AM Subject: [PHP-DB] Retruning an array from a row Hello All, How can I return and print an array from a user defined function from a database from a row like this,

Re: [PHP-DB] Inserting current date(MySQL)?

2002-10-30 Thread 1LT John W. Holmes
I'm my trying to insert to current date from a php form? I know that MySQL has a CURDATE() fucntion and PHP has several date function, but I cann't seem to get either to work? Here is my existing code: $ADDDATE=date(Y-m-d); [snip] VALUES ('$_POST[ADDDATE]', You've got two

RE: [PHP-DB] Multiple table select, but still returning row if no record exists in second table?

2002-10-30 Thread John W. Holmes
LEFT JOIN -Original Message- From: Leif K-Brooks [mailto:eurleif;buyer-brokerage.com] Sent: Wednesday, October 30, 2002 9:49 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Multiple table select, but still returning row if no record exists in second table? I'm using mysql. Is there

RE: [PHP-DB] HTML Select Boxes not displaying

2002-10-30 Thread John W. Holmes
What do you see in the HTML source of the browser's that don't work and how does it not work? The select boxes just don't show up at all? Do other form elements show up? ---John Holmes... -Original Message- From: Nigel Dunn [mailto:nigel.dunn;strobe.net.nz] Sent: Wednesday, October

Re: [PHP-DB] need help with SHOW Colums

2002-10-31 Thread 1LT John W. Holmes
So show us the code that you tried with. This code doesn't do us any good because it's not causing the error. ---John Holmes... - Original Message - From: David Rice [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, October 31, 2002 11:31 AM Subject: [PHP-DB] need help with SHOW

RE: [PHP-DB] string

2002-10-31 Thread John W. Holmes
DATE_FORMAT(your_column,'%b') or SUBSTRING() ---John Holmes... -Original Message- From: John Coder [mailto:jcoder;insightbb.com] Sent: Thursday, October 31, 2002 8:47 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] string I want to list months found in db by the first three letters as

Re: [PHP-DB] Am I doing This Right?

2002-11-01 Thread 1LT John W. Holmes
No, you're doing it wrong. ---John Holmes... - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, November 01, 2002 2:05 AM Subject: [PHP-DB] Am I doing This Right? ?php function war3_replays_submit() { if ( isset($replay_file) ) {

RE: [PHP-DB] Performance problems?

2002-11-02 Thread John W. Holmes
What's the structure of your database table? Whofor and id should have indexes on them to speed up queries like this. ---John Holmes... -Original Message- From: Leif K-Brooks [mailto:eurleif;buyer-brokerage.com] Sent: Saturday, November 02, 2002 1:21 AM To: [EMAIL PROTECTED]

RE: [PHP-DB] LIKE statement or IN statement?

2002-11-03 Thread John W. Holmes
You can't use wildcards with IN, only with LIKE or regular expressions. ---John Holmes... -Original Message- From: [EMAIL PROTECTED] [mailto:Amit_Wadhwa;Dell.com] Sent: Sunday, November 03, 2002 5:31 PM To: [EMAIL PROTECTED] Subject: RE: [PHP-DB] LIKE statement or IN statement?

RE: [PHP-DB] LIKE statement or IN statement?

2002-11-03 Thread John W. Holmes
ok so you would have to use : --select count(distinct itemid) from business where name like 'word1' or name like 'word2' or name like 'word3'; no other go. If you're not going to use wildcards, then you can use IN. The whole idea of using LIKE is that you can use _ and % as wildcards when

RE: [PHP-DB] Abstraction layer or not?

2002-11-05 Thread John W. Holmes
I'm working on a new site, and I'm wondering whether to use an abstraction layer or not. I don't have any plans to switch DB system, but you never know what the future holds. I figure that there's no reason not to, but are there any down sides? Which abstraction layers are good? ADOdb is

RE: [PHP-DB] Abstraction layer or not?

2002-11-05 Thread John W. Holmes
- From: Leif K-Brooks [mailto:eurleif;buyer-brokerage.com] Sent: Tuesday, November 05, 2002 9:28 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] Abstraction layer or not? True, but a DB wrapper can do the error reporting as well. John W. Holmes wrote: I'm working on a new

Re: [PHP-DB] mysql_fetch_array() question

2002-11-06 Thread 1LT John W. Holmes
That's not true. You can assign them to different variables and it works fine. $r1 = mysql_query(select * from main limit 1) or die(mysql_error()); $r2 = mysql_query(select * from apft limit 1) or die(mysql_error()); $row1 = mysql_fetch_array($r1); $row2 = mysql_fetch_array($r2);

Re: [PHP-DB] MySQL password protection?

2002-11-06 Thread 1LT John W. Holmes
I was wondering if it is possible to protect my password to the MySQL-server from being in a PHP-script. Now I can't do that, so everybody who gets to see my php-sourcecode also can see my (not protected/not encrypted) password. How can I change this? You can't, unless you want to put it in

Re: [PHP-DB] MySQL password protection?

2002-11-06 Thread 1LT John W. Holmes
John W. Holmes' [EMAIL PROTECTED]; William Trappeniers [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, November 06, 2002 5:30 PM Subject: RE: [PHP-DB] MySQL password protection? actually you can make a .php file with your connection info, include it in your .php files at the top

RE: [PHP-DB] Warning - newby question -- $_GET

2002-11-06 Thread John W. Holmes
I'm trying to call a script with the ?= after the php script name in the URL, but can't seem to pick up the variable to use in my script... any help would be greatly appreciated :) I'm calling the script with this url: http://localhost/Data/test/dbconnect2c.php?id=TestPage The section of

RE: [PHP-DB] indexing on existing DB

2002-11-08 Thread John W. Holmes
In MySQL, is there any difference between creating an index at table creation time, and creating an index on an existing table? Does an index created on an existing table re-index itself after each insert/update, or does it only index itself once - when you create the index? In the end, it's

RE: [PHP-DB] multiple mysql query in PHP mysql_query?

2002-11-08 Thread John W. Holmes
Hi, Can anybody give me a simple example of using PHP's mysql_query to perform mulitple mysql queries. I am using MySQl 3.23, trying to use create temporary table and insert ... select to overcome the lack of union operation in that verion of MySQL. Thanks! Mysql_query() can only do one

RE: [PHP-DB] Winamp-Like Search

2002-11-10 Thread John W. Holmes
Would it be possible to create a Winamp-like search in a web-based form (the search basically checks your list of music as you type and pulls all the matches it finds)? Say you pull the results of a SQL Query and assign them to a variable. Can you take user input and compare it to the

RE: [PHP-DB] Are there any Oracle vs Postgresql official benchmarks

2002-11-11 Thread John W. Holmes
Interesting Quote: MySQL's great performance was due mostly to our use of an in-memory query results cache that is new in MySQL 4.0.1. When we tested without this cache, MySQL's performance fell by two-thirds. ---John Holmes... -Original Message- From: Peter Beckman

RE: [PHP-DB] Access a Flat File DB - How?

2002-11-12 Thread John W. Holmes
On another topic...Does MySQL handle record locking and prevent multiple open edits by different users? Yes. ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

  1   2   3   4   5   6   7   >