[PHP-DB] MySQL/PHP date functions

2002-02-20 Thread Markus Lervik
Hello, all! Can anyone tell me how to easily calculate which days are on which week? ie, week 8 : 18. Feb - 24. Feb? I retrieve information from a database on a weekly basis, and I'd like print out what range of dates are on a specific week. I know about date(W...), but I really don't want to

RE: [PHP-DB] MySQL/PHP date functions

2002-02-20 Thread Markus Lervik
On Wed, 2002-02-20 at 13:16, Sven Jacobs wrote: You can do it like this calculate the current day and extract 7 days of it ehm? extract 7 days of it? from what?-) I'm not quite following... then with an array the current day until the calculated day :-) ehm, call me stupid, but I didn't

Re: [PHP-DB] SQL

2002-02-20 Thread Jonathan Underfoot
Actually, I'm running MS SQL which should allow me to sub-select Usually I work in MySQL -J - Original Message - From: Frank Flynn [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Tuesday, February 19, 2002 11:59 PM Subject: Re: [PHP-DB] SQL Jonathan, You

[PHP-DB] selecting question

2002-02-20 Thread ACEAlex
Hi i have trouble with this mysql query. OK, i have 3 different tables. Tabel 1: building_info id name price and other table 2:queue id building_id table 3:buildings_built building_id Ok, now i want to make a query that gets the data from building_info where it is not pressent in the queue and

Re: [PHP-DB] selecting question

2002-02-20 Thread Markus Lervik
On Wed, 2002-02-20 at 15:03, ACEAlex wrote: Hi i have trouble with this mysql query. OK, i have 3 different tables. Tabel 1: building_info id name price and other table 2:queue id building_id table 3:buildings_built building_id Ok, now i want to make a query that gets the data

RE: [PHP-DB] mysql LIMIT and ORDER BY problem

2002-02-20 Thread Rick Emery
it works for me. What do your data and table structures look like? -Original Message- From: Fredrik Wahlberg [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 19, 2002 4:55 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] mysql LIMIT and ORDER BY problem I have a strange problem with

[PHP-DB] mysql and auto_increment

2002-02-20 Thread Nautilis
Hi everyone My question is very simple, so i hope the answer will too :) Well i have an index field in my table which is set as auto_increment. Well question is, it's possible that mysql use values that have alredy been deleted from older regs? Thx in advance! -- PHP Database Mailing List

Re: [PHP-DB] selecting question

2002-02-20 Thread ACEAlex
Ok. i think i have to make things clearer :).. Here, is my real mysql thing. I and a friend are trying to make a silly space game and i have problems with this query. Ok, if i set up a database with this CREATE TABLE building_info ( id int(11) NOT NULL auto_increment, name varchar(32)

RE: [PHP-DB] mysql and auto_increment

2002-02-20 Thread Gurhan Ozen
Yes you sure can,.. When you insert a row just use one of the older values that no longer exists on the table.. Alternatively, you can insert a blank value, mysql will automatically set it to the next value after the highest one in the table and then you can update it to one of the older values.

RE: [PHP-DB] mysql and auto_increment

2002-02-20 Thread Rick Emery
First, what do you mean by regs? If I understand your question, you want to know if mysql will re-use an old auto_increment value that has been deleted. The answer is yes and no. If you say: DELETE FROM mytable; then the next insertion will cause the auto_increment value to begin at 1 If you

[PHP-DB] [OpenLink][ODBC][Driver]No key columns found for table referenced by keyset driven cursor

2002-02-20 Thread Paulo Freitas
Hi, I'm running True64 UNIX with ingres 6.4 and openlink ODBC. When i connect thru cgi(C/C++) it works fine but when i connect via PHP 4.1.1 gives me this error: [OpenLink][ODBC][Driver]No key columns found for table referenced by keyset driven cursor., SQL state IM909 in SQLPrepare I

Re: [PHP-DB] SQL

2002-02-20 Thread DL Neil
Jonathan, The original query doesn't work because the WHERE clause is evaluated earlier than the GROUP/COUNT(). Try putting num1 and num2 in a HAVING clause. Regards, =dn ok... authorizations and charges... two tables.. Card Number 1 gets authorized 20 times for use (20 rows in the

RE: [PHP-DB] SQL

2002-02-20 Thread Rick Emery
I tried the HAVING clause. it fails. This requires sub-selects or multiple tables -Original Message- From: DL Neil [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 20, 2002 10:27 AM To: Jonathan Underfoot; Rick Emery; [PHP-DB] Subject: Re: [PHP-DB] SQL Jonathan, The original

[PHP-DB] Deleting records...

2002-02-20 Thread jas
Ok I am trying to delete records from a database using an html form. I have 2 files, file one = remove.php3 which queries the database table and displays the current contents. Code is as follows. ?php require '../scripts/db.php'; $result = mysql_query(SELECT * FROM cur_inv,$dbh) or die(Could

[PHP-DB] Re: Deleting records...

2002-02-20 Thread jas
I forgot to include the error message I am recieving when trying to remove records using the check box. Parse error: parse error in /path/to/php/done2.php3 on line 22 Thanks in advance. Jas Jas [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Ok I am trying to

[PHP-DB] Re: A good tutorial

2002-02-20 Thread Jennifer Downey
Thanks Joe! This is exactly what I was looking for. Little tweaking and I was off and running. Thanks again Jen Downey Lerp [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi Jen, here's some code I posted up in the general ng for storing in db and

[PHP-DB] Re: A good tutorial

2002-02-20 Thread Lerp
You're welcome Jen :) Cheers, Joe :) Jennifer Downey [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Thanks Joe! This is exactly what I was looking for. Little tweaking and I was off and running. Thanks again Jen Downey Lerp [EMAIL PROTECTED] wrote in

Re: [PHP-DB] selecting question

2002-02-20 Thread ACEAlex
I could make a rutine in php to make it work but i want to make the datagrabbing thing in mysql :( - Original Message - From: Rick Emery [EMAIL PROTECTED] To: 'ACEAlex' [EMAIL PROTECTED] Sent: Wednesday, February 20, 2002 6:25 PM Subject: RE: [PHP-DB] selecting question I'm still

Re: [PHP-DB] selecting question

2002-02-20 Thread William Fong
Hmmm... Why do you want two or three tables? Why not just one? tbl.buildings and tbl.building_queue looks identical. Looks like you can merge the two and stick it in tbl.building_info. Just add in tbl.building_info a 'status' column. In that, I'd store say '1' for building in progress, and

[PHP-DB] Special Insertion Into MySQL - at a loss!

2002-02-20 Thread SpyProductions Support Team
I have a special set of information retrieved from a while loop that I would like a person to be able to edit and send back into a MySQL table. I know all of the basic MySQL commands for doing such, but the PHP side to get the input from the form to go in is really stumping me. This is what I

Re: [PHP-DB] selecting question

2002-02-20 Thread ACEAlex
Because the buildings that are avaible are stored in building info. There are the info that says what the benifit is of that building to :) They are not identical. A building type can exist on several places :) /Alexander - Original Message - From: William Fong [EMAIL PROTECTED] To:

Re: [PHP-DB] selecting question

2002-02-20 Thread William Fong
Ok... so tbl.building_info contains all the different types of buildings. Didn't get that... :) So what are the other types for then? They seem to be identical. -- William Fong - [EMAIL PROTECTED] Phone: 626.968.6424 x210 | Fax: 626.968.6877 Wireless #: 805.490.7732| Wireless E-mail:

Re: [PHP-DB] selecting question

2002-02-20 Thread ACEAlex
As i discribed (or did i??) building_info is for the different types of buildings. Buildings are for those who are currently built, and building_queue are for those who are on queue. I also have a key called planet_id that says on which planet we are looking at. /Alexander - Original

Re: [PHP-DB] selecting question

2002-02-20 Thread William Fong
That's what I'm talking about. Make that one table and put a 'status' column. Because then, wouldn't you be concerned on adding an entry to tbl.buildings and removing one from tbl.building_queue. -- William Fong - [EMAIL PROTECTED] Phone: 626.968.6424 x210 | Fax: 626.968.6877 Wireless #:

[PHP-DB] using sendtohost on a secure site

2002-02-20 Thread Jeremy Reed
The function sendtohost: -BEGIN CODE function sendToHost($host,$method,$path,$data,$useragent=0) { // Supply a default method of GET if the one passed was empty if (empty($method)) $method = 'GET'; $method = strtoupper($method); $fp = fsockopen($host,443); echo(open); if ($method

[PHP-DB] RE: [PHP] using sendtohost on a secure site

2002-02-20 Thread Jason Murray
The function sendtohost: [snip] Is great for posting results to a regular http site. But what I need to do is post to a secure site (https). At that point, you'll want to look into using CURL extensions to PHP. http://www.php.net/manual/en/ref.curl.php Jason -- PHP Database Mailing

[PHP-DB] SELECT where something exists but something else does not

2002-02-20 Thread Beau Lebens
Hey guys, I am a little stuck here, i know how to botch a solution together using a bunch of queries and PHP manipulation, but i am sure there is a more elegant way to do this one; i have some tables (i won't put their full defs, just bits that are relevant (they are huge)) TABLE students

[PHP-DB] Join

2002-02-20 Thread Jennifer Downey
Could someone point me in the right direction for joining tables? I have searched the php manual for it but only found info on joining arrays. If someone could point me to a code snip or a tutorial I would much appreciate it. Thanks in advance Jen Downey -- PHP Database Mailing List

RE: [PHP-DB] Join

2002-02-20 Thread Beau Lebens
what you are referring to actually has nothing to do with PHP Jen - that's why the manual wasn't much help :) JOIN is an SQL command, so check out the manual of your RDBMS (ie. http://www.mysql.com/doc/J/O/JOIN.html for MySQL) good luck :) Beau // -Original Message- // From: Jennifer

[PHP-DB] Re: php-db Digest 21 Feb 2002 02:46:40 -0000 Issue 1062

2002-02-20 Thread Frank Flynn
Beau, I've got two words for you - NOT IN - I'll even show you where those 2 words go: SELECT students.studentID, students.title, students.fname, students.lname, students.studentNo FROM students, theses WHERE theses.studentID=students.studentID AND theses.thesisID NOT IN (SELECT thesisID

[PHP-DB] update mysql bug/feature?

2002-02-20 Thread Marius Ursache
hi i have a form. i submit the form. the action should be an UPDATE to mysql table, so i have UPDATE table SET col1='$val1', col2='$val2' WHERE id = '$myid'. after i press the button, i have the message '0 rows changed'. if i press refresh (ctrl+r) and confirm resubmiting of form, the page

[PHP-DB] Double Dipping

2002-02-20 Thread John Hawkins
Sorry for the lack of information in the subject line, but I didn't know how else to explain it briefly... Howdy, yet again... Here's the build up... I have 2 tables and they look like this: table: teams ID leagueID divisionID name table: games ID leagueID divisionID team_a team_b date time