Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

Forms

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Forms

Postby R|R » Tue Jun 24, 2003 1:04 pm

Hey. I'm a 14 year old kid, who's learning php and MySQL. I'm really good at HTML, and I'm good at making tables in SQL format. My problem is I know hardly anything about php.

What I do know-

How to connect
How to use 'include'
Basically how it functions

So you can see I'm not a genius. However this is my first real go at making a display table and I need some help.

From using phpmyadmin it tells me that the php for altering or inserting a new row is (without the connect)-
Code: Select all
$sql = 'INSERT INTO `file_info` ( `file_id` , `file_name` , `file_url` , `file_description` , `file_date_added` , `file_author` , `file_votes_total` , `file_rating_total` , `file_expected` , `file_author_email` ) VALUES ( \'\', \'test\', \'http://www.test.com\', \'This is a test.\', CURDATE( ) , \'Jack\', \'0\', \'0\', \'2003-12-15\', \'jack@test.com\' ); ';

I understand this code at a fairly reasonable level. What i don't understand is how I do this from a form, and use the values as form data.

I don't need it done for me, but I would like someone to help me be on my way. After I figure this out, I'll need to display it. But I don't need that right now.

Thanks.[/b][/code]
R|R
New php-forum User
New php-forum User
 
Posts: 2
Joined: Tue Jun 24, 2003 12:51 pm
Location: ...

Postby Redcircle » Wed Jun 25, 2003 12:08 am

http://www.phpbuilder.com, http://www.devshed.com, and http://www.webmonkey.com have great tutorials fer newbies. check them out.
User avatar
Redcircle
Moderator
Moderator
 
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA

Postby R|R » Thu Jun 26, 2003 12:38 am

Well thanks.

Surprisingly I found a tutorial on how to do it before you posted that and I'm JUST about finished.

But I'm trying to implement a rating system... I know the basics of how it works.

Here's how I think. A page called 'view.php' and in this it has a form with some form of buttons that define the rating. Thinking probaly a radio.

Anyway... I've figured out this reading variables from a form thing, but that was using INSERT INTO $db (blah blah)

My problem. If it's a rating, a variable must be ALTERED. The code is ALTER TABLE, right? If someone could tell me, how to-

1) Alter a variable in a certain row. To define this row I would need to-
2) Define the row # depending on an #id. I've set up a value $file_id as an auto increment.

What I'm looking for is a code like-

$sqlquery = "ALTER TABLE 'file_info' VALUES('file_votes_total++','file_rating_total+=$radioboxentry')";

The problem I think is my syntax definetely, and the fact that I can't figure out which row to alter. The row I guess will be defined by the $file_id #?

If you need me to explain in more detail, just say. I hope this isn't asking to much. And I do know what I'm doing, so don't think you can't say some advanced sounding thing I won't understand.

Thanks alot.
R|R
New php-forum User
New php-forum User
 
Posts: 2
Joined: Tue Jun 24, 2003 12:51 pm
Location: ...


Return to PHP coding => General

Who is online

Users browsing this forum: No registered users and 3 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron