Jump to content

ask21900

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

ask21900's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I haven't wrote the code yet because I want to make sure I can do what I want it to before writing it, but here is some (very) rough pseudo code: //Upon initial load open first div form1 start textbox1.1 textbox1.2 submit close first div //after ajax call open first div display userId generated by php and returned by ajax display the data from form1 as returned by ajax display additional data supplied by php/ajax close first div open second div form2 start textbox2.1 //should be equal to the userId generated by php above textbox2.2 textbox2.3 submit form2 close second div Assigning the value to form2>textbox1 would work using the .value attribute, but if at all possible, I would like to do this without modifying my ajax function since I use it for hundreds of pages already. If it is necessary to use this method, I can duplicate my ajax function and make the mods just for this page, but I would rather not. Maybe I am going about this the wrong way... is there a way to modify the url/post data of a page using ajax (without refreshing)? For instance, can I just write the data in form1 to the url (in addition to the ajax get) so that it can be used by php during the scripting of form2?
  2. My javascript experience is a little limited so I was hoping someone can help me out... I have a form that is inserted into mysql by sending the data to a php script via ajax. The php script will return data to populate the div. I would then like to use a portion of the returned data to populate a second form on the page. Thanks in advance for all your help!
  3. Has anyone else noticed that 9 times out of 10 when a site you are visiting with Firefox sends/receives data from Google Analytics, Firefox crashes? I have searched for a fix extensively, but I can't find anything on the issue. All that comes up is a problem with Firefox viewing the Google Analytics site. This is starting to get really frustrating, and I can't find anybody else that has this problem...
  4. Man, I love your signature! On topic though... Sun has been great with everything that they have done. Adding MySQL to the mix is definately a great thing!
  5. 26, never been married (but close).  I grew up in Cali, playing sports and surfing.  Started a computer repair company, but got so big that I had to hire a few techs.  Now they do my repair work for me.  Now I'm a full-time coder.
  6. About 60k here in LA, Ca, US... but for the record, you can't get a house for under a mil
  7. That worked. Thank you so much. (I was also missing an ending quote)
  8. The error msgs were in the original post:
  9. That's what i thought, but i had nothing better to do than add the statement.
  10. The error is with the query: SELECT * , SUM(ClientPayments_Amount) AS TotSales FROM ClientPayments GROUP BY ClientPayments_ReceivedBy WHERE ClientPayments_Received='True' AND ClientPayments_Date between '1180681200' AND '1183273199' btw: with the function, I also tried mysql_fetch_assoc($result) with the same results. It occurred to me that the error might be caused when 0 rows are returned. I doubt it, but what do I know. To fix this, I have now added a conditional statement based on the number of rows returned.
  11. mysql Ver 12.22 Distrib 4.0.16 I have only dabbled in sql and php for several years, so please forgive my ignorance for stupid errors. function addcommission(){ dbConnect(); $array = array(); $lastmonthbegin = strtotime( "-1 month", mktime( 12, 0, 0, date("m"), 15, date("Y") ) ) - 1252800; $lastmonthend = strtotime("+1 month", $lastmonthbegin) - 1; $query = "SELECT * , SUM(ClientPayments_Amount) AS TotSales FROM ClientPayments GROUP BY ClientPayments_ReceivedBy WHERE ClientPayments_Received='True' AND ClientPayments_Date between ".$lastmonthbegin." AND ".$lastmonthend." "; $result = mysql_query($query); while($row = mysql_fetch_array($result)){ //$array[] = $row; echo "Total ". $row['ClientPayments_ReceivedBy']. " = $". $row['SUM(ClientPayments_Amount)']; echo "<br />"; } dbClose(); } When executing the function i receive "Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource...". With mysql_error() it says "You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE ClientPayments_Received='True' AND ClientPayments_Date be " First, I would like to know what is wrong with the query. Next, I would like to find out if there is another (easier) way of accomplishing what I need. I am simply trying to create a function to run once every month that will find the total sales in the previous month by each employee and place the employee id, total sales by that employee, and a commission value (based on a calculation of the total sales) to another table. Thanks in advance for any help.
  12. Yeah... My original code had that... Must've got lost in the cut and paste. Same results.
  13. mysql Ver 12.22 Distrib 4.0.16 dbConnect(); $sql = 'INSERT INTO `Client`( `Client_FName` , `Client_LName` , `Client_CName` , `Client_Street` , `Client_City` , `Client_State` , `Client_Country` , `Client_Zip` , `Client_PhoneCountry` , `Client_PhoneArea` , `Client_PhonePrefix` , `Client_PhoneNum` , `Client_Email` , `Client_StartDate` , `Client_BillDate` , `Client_CurrentQuota` , `Client_CurrentPricePerGig` , `Client_SalespersonID` ) VALUES ( 'Client_FName', 'Client_LName', 'Client_CName', 'Client_Street', 'Client_City', 'St', 'USA', 'Client_Zip', '1', '213', '555', '1212', 'Client_Email', NOW( ) , '3', '5', '2.00', '1' );'; dbClose(); echo "Client Successfully Added!"; Ok. Here's my problem. The DB connects, runs the query, closes the DB and prints the success msg, all without any errors. The server shows that the query was made. Sounds great right? The problem is that the database never updates. No data is in the DB whatsoever. I have tried every possible variation of the code that I can think of, and receive the same results. I have tried it with my original variables, as well as "hard-coding" the date (as above), and still nothing. BTW: The code sample above is not mine, it is the code that was put out by phpMyAdmin. Can anyone tell me anything about this, or what might be happening? Thanx.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.