![]() |
having trouble updating with mysql
my mind wasnt working when i coded the data that gets inserted but this is what the table looks like
![]() btw, that image is two tables joined together. what my problem is , is that what type of query do i write if i want to change one of the rows because what is happending is when i write something like Code:
mysql_query("update tbl_userpackage set status = 'completed' where hash = '$hash'");because the html would look something like this Code:
<select name="package">Code:
<select name="package">please if u can give me a solution i would greatly appreciate it, no one has been able to help me out. i am loosing it. thank you soo much. |
Code:
mysql_query("update tbl_userpackage set status = 'completed' where hash = '$hash'");Code:
mysql_query("update tbl_userpackage set status = 'completed' where some_id = '$passed_id'");well, i think you better use a unique id of each row such as (id) in the where clause rather than using the hash value. Because based on what i noticed, some of the hash are the same and for quite some time it can't be avoided that there will be same hashes in different accounts. Other way, if your update code is separated in a different page, try to make sure that you have pass the right variable to use in updating the rows. I have tried to make this mistakes before when im making a project and just notice i have pass no-value variable/parameter to the page (or either way check the variables you are passing if ever). regards, t3st |
thanks for your reply, your english was good no need to worry :) btw, is there any way i can contact you? by msn, aim, or email?
i need to show you my code that way you will make better sense of my problem. thanks |
im afraid i can't be online just this moment, because im still having a class right now.
But if ever i can access a messenger, will you please leave or pm me your contact. Thnx. |
Quote:
sarmenhb@yahoo.com |
are you still having problems with updating? then i will try to be online on my messenger later.
btw, its 11 am here PHT, i think i will be online on nightime. :) |
hi, actually thanks i think i figured out the problem.
i did notice one thing though php doesnt like it when you create a variable like this $item_$value = "something"; or like this $item_{$value} = "something"; i wonder if it is possible to make variables dynamically. i was doing this like this Code:
for($i=0;$i<=100;$i++) { |
in your code maybe you can do something like that using the concatenation operator.
Code:
for($i=0;$i<=100;$i++) {And also in declaring variables, as far as i know, im only using these type of methods. Code:
$my_variable = 'something';maybe for some reasons you can declare variable like this. Code:
$cnt = 'something';Maybe it is possible. :) All the best, t3st |
| All times are GMT. The time now is 09:22 AM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0