|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#16
|
||||
|
||||
|
Ahhh I feel so embarrassing to say "NO"!!
|
|
#17
|
||||
|
||||
|
the comments table is very imp. Can I alter it now by adding a column id, autoincrement????
Will it affect data in there? Coz once I had scred the whole db and I was in trouble. I dont want to do it again!! Should i add one column of id and one column of update(link to update.php passing the row id)????????????? |
|
#18
|
||||
|
||||
|
You do need an auto-incrementing unique identifier in your comment table, yes. We need to have a way to reference each comment fast and easy.
__________________
FREE Web Development Videos | PHP Reference | MySQL Reference | jQuery Documentation Markup Validation | CSS Validation | Web Developers, get FireBug & IE Developer Toolbar When seeking help: Submit clear questions and code. Use syntax highlighting. Be patient, and respectful. Don't abuse your access to professional guidance - nobody here is obligated to answer your questions, be thankful that they do. Are you a good person? |
|
#19
|
||||
|
||||
|
Ok i added the c_id with autoincrement .
So now all the comments has an id |
|
#20
|
||||
|
||||
|
Excellent. Did you want to leave the problems as text, or did you want to build a problems table, and build a relationship there by placing the problem id in the comments table as an integer?
|
|
#21
|
||||
|
||||
|
there are not much options in there so would it be ok to leave it as it is???
Coz I will have to change many pages that are related to it. Well for now we can try without making problem table. Later I will copy the whole db and try again. |
|
#22
|
||||
|
||||
|
I also did this :
It has an edit button which takes you to the edit.php page. Do I need to add anything to pass values? PHP Code:
|
|
#23
|
||||
|
||||
|
Having the edit button is good. Go ahead and append the variable to the end of the action value of the form.
Code:
<form method="post" action="edit.php?id={$commentid}">
<p><input type="submit" name="edit" value="Edit" /></p>
</form>
On a side note, remember to always puts quotes around your values ![]() |
|
#24
|
||||
|
||||
|
Ahh, I did that already.....
![]() Now lets move on to edit.php page where to start? What do i do next? |
|
#25
|
||||
|
||||
|
Alright, so on edit.php are you able to print the comment id from the $_GET array?
|
|
#26
|
||||
|
||||
|
Yup, it prints the id .
PHP Code:
|
|
#27
|
||||
|
||||
|
Now, I have this small window via which they had previously entered the data.
We can use that, but only thing that we have to do is to just have the values of dropdown, text, radio button, DISPLAYED apart form the other values. I will post the code of that small window. PHP Code:
|
|
#28
|
||||
|
||||
|
|
|
#29
|
||||
|
||||
|
I did this but it is printing :
0) { $comment = mysql_fetch_assoc($rst); } return $comment; } ?> But there is no error???? I dont know y? PHP Code:
|
|
#30
|
||||
|
||||
|
Start your page with <?php instead of <?
Also, this is a .php file, right? |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > PHP Development > Edit problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|