Ok, let me try it another way. What do you think is the purpose of mysql_query() or mysql_db_query()? What does it do? And therefore what happens if it isn't present?Erick020 wrote:Look, you can see in the $q echo, the INSERT is OK... all values are present...:
insert into BESTELLING (Afnemer_ID, Leads_Kind, Aantal, Betaald, Datetime) values ('87', 'HYPOTHEEK', '3', 'NO', '1180203353')
so, this is 100% OK.
but never mind, this is NOT important....
Multiple Update
Moderator: General Moderators
This is very easy:volka wrote:Ok, let me try it another way. What do you think is the purpose of mysql_query() or mysql_db_query()? What does it do? And therefore what happens if it isn't present?Erick020 wrote:Look, you can see in the $q echo, the INSERT is OK... all values are present...:
insert into BESTELLING (Afnemer_ID, Leads_Kind, Aantal, Betaald, Datetime) values ('87', 'HYPOTHEEK', '3', 'NO', '1180203353')
so, this is 100% OK.
but never mind, this is NOT important....
First you have a script to select some data, if the database is empty you get "no data", if there are any, you get a list of the data you have selected (script:Show_Leads_H.php).
From there you have to confirm your order and when you click on the "confirm link" you run Command_Leads_H.php and i must update the database, means I must put in all selected arrays (to find in the Show_Leads_H.php script) some informations like (company_ID).
The problem is that selected arrays get lost (on the script Show_Leads_H.php, I can see: <input type=hidden name=Aanvraag_ID[0] value=28>, <input type=hidden name=Aanvraag_ID[1] value=29>), and it suppose to update the arrays 28, 29... but this information get lost and will not update anything...
Do you get the picture?
Look, I am no expert... so if you get the picture, and understand what i am trying to do, please help me with a simple script, because i get really confused.volka wrote:That was so not my question.
What does the function mysql_query() do?
I must update some specific arrays that are defined on a page and I cannot send the info to the next page (the update script).
Here the page:volka wrote:That was so not my question.
What does the function mysql_query() do?
http://sales.bestefinancieringen.nl/SCR ... k.php?A=87
don't change the settings, (only the first table works) --> choice: 1 0... click on SELECTEREN
then type 3 for exemple and click on TONEN and then on ORDER BEVESTIGEN
You can see I think what happends
What does mysql_query do? (mysql_query and mysql_db_query are similar)
see http://de2.php.net/mysql_query
see http://de2.php.net/mysql_query
mysql_query SELECT THE DATA THAT ARE SHOWN ON THE PAGEvolka wrote:What does mysql_query do? (mysql_query and mysql_db_query are similar)
see http://de2.php.net/mysql_query
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
I do NOT have any trouble with the INSERT.... it works fine...Jcart wrote:Let me answer this question for you, it executes the query. If you do not execute the query, in your case the insert statement, then nothing will be inserted.
The update (competely separate from the INSERT) does not work... so please just forget the INSERT... and help me to update several arrays at the same time..
I finally have on a page:
ID[0] = 1
ID[1] = 5
ID[3] = 8
and I need to update some data (lets say company_ID=87) into all these arrays, that's it
Last edited by Erick020 on Sat May 26, 2007 2:03 pm, edited 1 time in total.
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Look this is what I mean... this is wrong, I know that....volka wrote:Sorry, there is no easy fix.
There's a fundemental misunderstandig inand the flop trying to explain the lesser errors or strange things in the script I very much doubt I can explain this to you. Good luck anyway.WHERE
'Aanvraag_ID[$i]' = 'Aanvraag_ID[$i]
If you understand what I want to do, don't try to fix what i did, just send what you think it should be.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Ok, take this line of code:
It does absolutely nothing other than create a string which we do nothing with.
Now take this:
It runs that string as a MySQL query. You're missing the call to mysql_query() in your code.
I'll also take a wild stab in the dark that this bit of code:
Should be:
Code: Select all
$q = "UPDATE users SET last_login = NOW() WHERE id = '" . mysql_real_escape_string($userId) . "' LIMIT 1";Now take this:
Code: Select all
$q = "UPDATE users SET last_login = NOW() WHERE id = '" . mysql_real_escape_string($userId) . "' LIMIT 1";
mysql_query($q);I'll also take a wild stab in the dark that this bit of code:
Code: Select all
WHERE
'Aanvraag_ID[$i]' = 'Aanvraag_ID[$i]Code: Select all
WHERE
Aanvraag_ID = 'Aanvraag_ID[$i]