![]() |
| ||
| updating records using php and mysql hi, I am creating a form for user to update their details which is saved in the database. So far i can show their details in the form where i have a submit button but the updating part doesnt work(it doesnt update at all). here is the code: <html> here is the table: CREATE TABLE Member( |
| ||
| Re: updating records using php and mysql i ran a search in the php documentation. i dont know if this will help, but its worth checking out. http://us2.php.net/manual/en/function.newt-refresh.php |
| ||
| Re: updating records using php and mysql According to the UPDATE syntax, I observe that your $query1 is missing the WHERE clause to select the record or records to be updated. The specification says that if the WHERE is missing, every row in the table will be updated!. I do not thik that that is what you want. i i am correct, you should add to $query1 the following text: WHERE LoginName='$username''; |
| ||
| Re: updating records using php and mysql no worries guys it is solved:cheesy: |
| ||
| Re: updating records using php and mysql how did you solve it? I really need to know...our project is due next week,,,please... |
| ||
| Re: updating records using php and mysql Hi, if you don't have the WHERE clause in your sql script, your entire table will be update, but if you don't see this you probably have some other errors. try use: mysql_query($sql) or die(mysql_error()); also try to use addslashes() function to escape some chars. |
| ||
| Re: updating records using php and mysql as said above just use the where clause and u should be fine mate |
| ||
| is there any code of adding record using drop down menu? or should i say,the <select><option> function?all i know is input text area..tnx.. |
| ||
| its the same as u would do for input text... just access the data from ur post variable as $_POST["yourSelectName"] and u can very well add it to ur record as u do for text. the post variable will contain the value of option which user selected... Quote:
|
| ||
| yap.. Quote:
>> so the code will be <select name="sample here"> <option value="<?php echo $row_sample here['sample here']?>" ? i used the this array > while ($row= mysql_fetch_array($result)); before declaring the <select name =" "> and it's value..there's an error with that. the error was "< and >" but i can't find which "< and >" is wrong. |
| All times are GMT -4. The time now is 9:19 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC