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


Ask about general coding issues or problems here.

Moderators: macek, egami, gesf


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\', \'\', \'This is a test.\', CURDATE( ) , \'Jack\', \'0\', \'0\', \'2003-12-15\', \'\' ); ';

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.

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,, and have great tutorials fer newbies. check them out.
User avatar
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.
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: Google [Bot] and 1 guest

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