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

2004-06-22 Thread David Robley
Justin Baiocchi wrote: > Hi, > > I am trying to do the following: > - retrieve data from a table based on the $id field (easy enough) > - add a few more fields to the data set, then > - enter the data (and new fields) into a new table (based on the > selected $id field) > > I'm just not sure how

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 Databas

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

2004-06-22 Thread Shahmat Bin Dahlan
Yes, your right, but I also think his MySQL SQL statement needs to be checked. Maybe can also try to add this right after the mysql_query function call. echo mysql_errno() . ": " . mysql_error() . "\n"; - Original Message - From: "Cole S. Ashcraft" <[EMAIL PROTECTED]> Date: Wednesday,

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] 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 st

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 Shahmat Bin Dahlan
Your SQL statement: 'SELECT Rune, username FROM RuneRunner RuneRunner_1 WHERE (User_ID = 3)' What is "RuneRunner" and "RuneRunner_1"? Are these two different tables. If it is, you might want to separate them with a comma. Why not try getting rid of the brackets surrounding "User_

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 > > reso

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

2004-06-22 Thread Daniel Clark
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 ... > "Daniel Clark" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> What error are you ge

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

2004-06-22 Thread water_foul
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in ... "Daniel Clark" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > What error are you getting? > > > why doesn't this work: > > $pic=mysql_query('SELECT Rune, username FROM RuneRunn

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'

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: http://www.ph

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, use

[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

[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 di

RE: [PHP-DB] Retrieve data, add new fields and enter it in new table

2004-06-22 Thread Justin.Baiocchi
Thanks Gary and those who replied, What I have ended up doing is using 3 tables: the original, a temporary one and the target table. It's clunky and probably not the way to do it, but this is my first php application and is just a learning exercise. -Original Message- From: Gary Every [

[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 unsubsc

RE: [PHP-DB] Retrieve data, add new fields and enter it in new table

2004-06-22 Thread Gary Every
Let's say you want to build a table with a couple extra fields, say the name associated with the id, and today's date Try: CREATE TABLE new_table SELECT t1.id, t2.id_name, NOW() FROM table1 t1, table2 t2 WHERE t1.id=t2.id This will build a table with all the id's from table1 that have an associa

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

Re: [PHP-DB] Multiple Inserts

2004-06-22 Thread Daniel Clark
Any errors? Is the all the other data inserting into the second table? > 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? > > $r

Re: [PHP-DB] Multiple Inserts

2004-06-22 Thread dpgirago
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 am using a form to Insert data into 2 tables in the same database. > $

[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 " .

[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: 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