RE: [PHP-DB] Security concern with web forms (update of MySQL data base)

2002-03-02 Thread Boaz Yahav
1st, you should limit the permissions that you have for the user doing the update. This user should not be able to do things like ALTER / DROP / CREATE etc... If you don't have a need for the DELETE command you can remove the permissions for it to, however this does not solve all of your problems

RE: [PHP-DB] easy date format question

2002-03-02 Thread Boaz Yahav
or : $sql="INSERT INTO table (date) VALUES (now())"; -Original Message- From: Jim Lucas [php] [mailto:[EMAIL PROTECTED]] Sent: Saturday, March 02, 2002 2:11 AM To: [EMAIL PROTECTED]; Matthew Crouch Subject: Re: [PHP-DB] easy date format question $today = date("Ymd"); $sql = "INSERT int

[PHP-DB] Number of working hours in a month.

2002-03-02 Thread Hoo Kok Mun
Dear all, How do I dynamically calculate how many working hours in a particular month? Has anyone do it before? Here is the simple formula. Add - Number of days in a month Deduct - Sundays Number of Mon-Fri in a month * 8 hours Number of Sat in a month * 4 hours My Figure = total working hours o

[PHP-DB] Re: Display in drop-down box

2002-03-02 Thread Joe Van Meer
Hi there:) I use odbc so you'll have to change your functions if you're using mysql //connect to db $connectionToDB = odbc_connect("cdconsultant", "joecon", "joecon"); //create query statement $sqlr = "SELECT DISTINCT category FROM CONSULTANT ORDER BY category" ; //execute the sql statement (

[PHP-DB] Difficult count statement. Need some sql advice

2002-03-02 Thread Andy
Hi there, I would like to querry my db for following result - Count the number of topics listed in the table fo_topics, but only the topics where the belonging forum is not in the archive mode ( this is when table fo_forums field archive is 1) I tryed following querry but this is for sure wron

Re: [PHP-DB] Difficult count statement. Need some sql advice

2002-03-02 Thread Bill Morrow
On Sat, Mar 02, 2002 at 05:36:41PM +0100, Andy wrote: > Hi there, > > I would like to querry my db for following result > > - Count the number of topics listed in the table fo_topics, > but only the topics where the belonging forum is not in the archive mode > ( this is when table fo_forums fie

[PHP-DB] Re: Difficult count statement. Need some sql advice

2002-03-02 Thread Frank Flynn
Well off the top I'd say your forgot the join condition between the fo_topics and the fo_forums tables. Right now you're counting the Cartesian product of the two tables. Also you can't select an aggregate function (like count) and regular columns without a group by on the same columns. F on 3

RE: [PHP-DB] Force Refresh on Another Window w/ Javascript

2002-03-02 Thread Boaz Yahav
Instead of just closing the window try this : Echo"opener.location.reload(); window.close(); "; Sincerely berber Visit http://www.weberdev.com Today!!! To see where PHP might take you tomorrow. -Original Message- From: Shahmat Dahlan [mailto:[EMAIL PROTECTED]] Sent: Thursday,

Re: [PHP-DB] Retrieving a date.

2002-03-02 Thread DL Neil
Ken, Check out DAYOFMONTH() and MONTH() and a wealth of other useful date functions. RTFM: 6.3.4 Date and Time Functions The answer to your question about AUTO_INCREMENT 'reset' can be found at 6.5.3 CREATE TABLE Syntax under "table_options". Regards, =dn > I have a test table with the ususal

[PHP-DB] Anyone with suggestions to make this run faster?

2002-03-02 Thread Aron Pilhofer
hey folks, I just got done writing a function to help with my data cleaning. It works - actually a lot better than I thought it would - but I am sure there are ways I could optimize this somewhat. The function takes two result sets (usually first name, last name, city, state, zip) from two tables

RE: [PHP-DB] Number of working hours in a month.

2002-03-02 Thread Shrock, Court
I just ran across this description[1] that points to this link[2]. HAven't tried it personally, and the site requires a login, so you might not find it useful, but just in case. [1]Count how many weeks in the month have a specified day, such as Mon, Tue, etc. Var avail - number of days - first d

[PHP-DB] Retrieving date, partially solved

2002-03-02 Thread Ken Thompson
I have the thing returning the date as long as the date format is "m/d" in the table with a seperate year column. Here's the table: mysql> select * from Cinfo; +-++--+---+---+ | Cid | Fname | Lname| Bday | Byear | +-++--+---+---+ |

Re: [PHP-DB] Retrieving date, partially solved

2002-03-02 Thread DL Neil
Ken, If it works, it works! If you want to store the birthdate in a single column in the db, then make the datatype a date in CCYY-MM-DD format, then prepare the query by asking PHP for the server's date as month (MM) and day (DD) and apply those to the query using the functions I pointed you at

Re: [PHP-DB] Retrieving a date.

2002-03-02 Thread Ken Thompson
On Saturday 02 March 2002 16:13, DL Neil wrote: > Ken, > > Check out DAYOFMONTH() and MONTH() and a wealth of other useful date > functions. RTFM: 6.3.4 Date and Time Functions There's a few interesting items here OK, Thanks for the pointer. > The answer to your question about AUTO_INCREMENT 're

RE: [PHP-DB] Number of working hours in a month.

2002-03-02 Thread Manuel
Hi there, Thanks, the article was posted by me at that site. I have a few different email addresses to a point I forgot which and which.. I have solved the problem. Here are the codes. 5 // // Initial formula doesn't work well, so I "reversed-engineered" to get the formula. // 0 - Sunday,...,6

[PHP-DB] Tutorial?

2002-03-02 Thread Jennifer Downey
Hi all, Can anyone point me to a good tutorial on how to disable a submit button once clicked? preferably in php. Thanks Jennifer Downey -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php