[PHP-DB] Re: Subject: Retrieve data, add new fields and enter it in new ta

2004-06-22 Thread Neil Smith [MVP, Digital media]
Look at the INSERT... SELECT syntax in the MySQL manual Basically you can do this but only between 2 different tables (which is what you specified) : Generate and *test* the SELECT statement you want to use to recover your data set. Then in PHP try a query like this : $query=INSERT INTO table2

[PHP-DB] Multiple Inserts

2004-06-22 Thread Achieve IT
Hello, I am using a form to Insert data into 2 tables in the same database. $TimesheetID needs to be in each table. However, it is not being inserted into the second table, tblTimesheetDetails . Any advise? $result_timesheet=mysql_query(INSERT INTO tblTimesheet (TimesheetID, WorkerID, ClientID,

[PHP-DB] Re: Multi search function (help)

2004-06-22 Thread Amit Arora
In that case you can do something like this: $s_where = ''; foreach (array('name', 'lastname', 'nickname') as $e) { $s_where .= (!empty($s_where) ? ' AND ' : '' ) . (!empty($_REQUEST[$e]) ? $e='$_REQUEST[$e]' : '' ); } $result = mysql_query(SELECT id, name , lastname , m_date from users .

Re: [PHP-DB] Multiple Inserts

2004-06-22 Thread Daniel Clark
Good point. Since it's form data, what about $_POST['TimesheetID'] ? Don't see anything obviously wrong with your query string. Are the inserts happening in the same block of code, i.e., are you sure that _$TimesheetID_ has a value in it when you're performing the second insert? -dave I

[PHP-DB] MYSQL Too Many Connections

2004-06-22 Thread John
How do I enable more connections for mysql. the default is 100 but i want to set more. does anyone know? -- ** Free Nokia Ringtones US http://www.ring-tones.us ** -- PHP Database Mailing List (http://www.php.net/) To

[PHP-DB] Re: Multiple Inserts

2004-06-22 Thread Kim Steinhaug
A simple way to debug your scripts would be like this : FROM : $result_timesheet=mysql_query(INSERT INTO tblTimesheet (TimesheetID, WorkerID, ClientID, TimesheetDate, ProspectiveOrRetrospective) VALUES ('$TimeSheetID','$WorkerID','$ClientID','$TimesheetDate','$ProspectiveOrRetr ospective'))or

[PHP-DB] problem....

2004-06-22 Thread water_foul
why doesn't this work: $pic=mysql_query('SELECT Rune, username FROM RuneRunner RuneRunner_1 WHERE (User_ID = 3)',$connection); $pic=mysql_fetch_array($pic); -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] problem....

2004-06-22 Thread Cole S. Ashcraft
Just from looking at it, it seems to be because you are redefining a variable, which destroys it, then calling for a mysql resource that has been destroyed. What is the error? I can't gaurantee that that is what is happening. Cole why doesn't this work: $pic=mysql_query('SELECT Rune,

Re: [PHP-DB] problem....

2004-06-22 Thread Daniel Clark
What error are you getting? why doesn't this work: $pic=mysql_query('SELECT Rune, username FROM RuneRunner RuneRunner_1 WHERE (User_ID = 3)',$connection); $pic=mysql_fetch_array($pic); -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP-DB] problem....

2004-06-22 Thread water_foul
I tried that it didn't work Cole S. Ashcraft [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Just from looking at it, it seems to be because you are redefining a variable, which destroys it, then calling for a mysql resource that has been destroyed. What is the error? I can't

Re: [PHP-DB] problem....

2004-06-22 Thread water_foul
I checked em all they were right Daniel Clark [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Sounds like it doesn't like your SQL statement. Perhaps a field or table name is incorrect? Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in

Re: [PHP-DB] problem....

2004-06-22 Thread water_foul
i fixed those things and it didn't fix it :( :( :( :( :( :( :( :( :( is there a icq chatroom for php?) Shahmat Bin Dahlan [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Your SQL statement: 'SELECT Rune, username FROM RuneRunner RuneRunner_1 WHERE (User_ID = 3)'

Re: [PHP-DB] problem....

2004-06-22 Thread Cole S. Ashcraft
The error he is getting means that his MySQL resource (in this case the results of the query) does not exist. Try $pic1=mysql_fetch_array($pic); Also, can you give the exact text of the error (line number and all) and line numbers for the entire passage? Cole Shahmat Bin Dahlan wrote: Your SQL

Re: [PHP-DB] problem....

2004-06-22 Thread Cole S. Ashcraft
I need the exact error message. Copy Paste it from the browser. I also need line numbers. Cole water_foul wrote: i fixed those things and it didn't fix it :( :( :( :( :( :( :( :( :( is there a icq chatroom for php?) Shahmat Bin Dahlan [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]

Re: [PHP-DB] MYSQL Too Many Connections

2004-06-22 Thread Sumito_Oda
Hi, Refer to http://dev.mysql.com/doc/mysql/en/Too_many_connections.html Concretely, the description below is added to the [mysqld] section of my.cnf (my.ini for Windows), and mysqld is rebooted. [mysqld] set-variable=max_connections=500 -- Sumito_Oda mailto:[EMAIL PROTECTED] -- PHP