Welcome to Tech Support Forum home to more then 136,000 problems solved. Issues have included: Spyware, Malware, Virus Issues, Windows, Microsoft, Linux, Networking, Security, Hardware, and Gaming Getting your problem solved is as easy as:
1. Registering for a free account
2. Asking your question
3. Receiving an answer

Registered members:
* Get free support
* Communicate privately with other members (PM).
* Removal of this message
* See fewer ads.
* And much more..

 



Want to know how to post a question? click here Having problems with spyware and pop-ups? First Steps
Go Back   Tech Support Forum > Design Forum > Web Design & Programming
User Name
Password
Site Map Register Donate Rules Blogs Mark Forums Read


Web Design & Programming Discussion of web design, and server-side & client-side scripting

Reply
 
LinkBack Thread Tools
Old 06-15-2009, 08:38 PM   #1 (permalink)
Troubled
 
Join Date: May 2009
Posts: 71
OS: Computer = WXP, Server = linux w/ php 5


PHP help - please help!

i am trying to track scores for rock band, like www.scorehero.com
i want it to be viewable like this




just using a mysql DB/php 5
please help, i have spent 60+ hours on this
calthephenom is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Important Information
Join the #1 Tech Support Forum Today - It's Totally Free!

TechSupportForum.com is a leading support website for your computer needs. We offer free, friendly and personalized computer support. Why pay to have your computer fixed when you can do it for free.

Join TechSupportforum.com Today - Click Here

Old 06-16-2009, 05:04 AM   #2 (permalink)
Moderator, TSF Articles
 
carsey's Avatar
 
Join Date: Aug 2006
Location: Hunwick, Co. Durham England
Posts: 10,671
OS: XP Pro SP3

My System

Send a message via MSN to carsey
Re: PHP help - please help!

Explain what you want to do with the data.

Do you want to echo all the data from the database into the table?
__________________

carsey is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 06-16-2009, 05:03 PM   #3 (permalink)
Troubled
 
Join Date: May 2009
Posts: 71
OS: Computer = WXP, Server = linux w/ php 5


Re: PHP help - please help!

Quote:
Originally Posted by carsey View Post
Explain what you want to do with the data.

Do you want to echo all the data from the database into the table?
yes, you can submit it in a form, to a database, and it will echo what you posted into a table
calthephenom is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 06-16-2009, 05:13 PM   #4 (permalink)
Design Team Member
 
Redcore's Avatar
 
Join Date: Aug 2007
Location: Jamestown, CA
Posts: 700
OS: Linux Mint 8

My System

Re: PHP help - please help!

This is real basic stuff...how many tutorials did you look at/try in those 60 hours?

My favorite PHP/MySQL tutorial:
http://www.freewebmasterhelp.com/tutorials/phpmysql
__________________
Free Resources
PC Protection - Comodo Firewall | AVG Anti-Virus | WinPatrol | Ad-Aware | Spybot S&D | SpywareBlaster |
Web Design/Programming - KompoZer
(Editor) | Paint.NET (Graphic) | GIMP+GIMPShop (Graphic) | FileZilla (FTP Client) | Free Hosting |
Redcore is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 06-16-2009, 05:38 PM   #5 (permalink)
Troubled
 
Join Date: May 2009
Posts: 71
OS: Computer = WXP, Server = linux w/ php 5


Re: PHP help - please help!

Quote:
Originally Posted by Redcore View Post
This is real basic stuff...how many tutorials did you look at/try in those 60 hours?

My favorite PHP/MySQL tutorial:
http://www.freewebmasterhelp.com/tutorials/phpmysql
will u please write me the script i would need
i am begging you, i am a complete noob at php
PLEEEEZE!!!!!!!!!!!!!
calthephenom is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 06-16-2009, 05:41 PM   #6 (permalink)
Moderator, TSF Articles
 
carsey's Avatar
 
Join Date: Aug 2006
Location: Hunwick, Co. Durham England
Posts: 10,671
OS: XP Pro SP3

My System

Send a message via MSN to carsey
Re: PHP help - please help!

What have you got at the minute?

its a very simple case of connecting to the database, querying the data you want to show and sticking it in a echoed row on the table.
__________________

carsey is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 06-16-2009, 05:48 PM   #7 (permalink)
Design Team Member
 
Redcore's Avatar
 
Join Date: Aug 2007
Location: Jamestown, CA
Posts: 700
OS: Linux Mint 8

My System

Re: PHP help - please help!

This is a support forum, not a free labor forum :P I get paid to do that stuff, why would I do it for free? Anyways you'll never learn anything from it and you can't always get people to do free work on your site. You need to be able to fix and update it on your own, unless you plan on paying someone to help or know someone that is willing to do it for free quite frequently (I guarantee that kind of offer runs thin when they're doing your site for you all the time).

Take a look at the article and take an honest try at making the script and then we'll take a look at it for you and help you along.
__________________
Free Resources
PC Protection - Comodo Firewall | AVG Anti-Virus | WinPatrol | Ad-Aware | Spybot S&D | SpywareBlaster |
Web Design/Programming - KompoZer
(Editor) | Paint.NET (Graphic) | GIMP+GIMPShop (Graphic) | FileZilla (FTP Client) | Free Hosting |
Redcore is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 06-16-2009, 05:48 PM   #8 (permalink)
Troubled
 
Join Date: May 2009
Posts: 71
OS: Computer = WXP, Server = linux w/ php 5


Re: PHP help - please help!

Quote:
Originally Posted by carsey View Post
What have you got at the minute?

its a very simple case of connecting to the database, querying the data you want to show and sticking it in a echoed row on the table.
i have the form
<form action="scores.php" method="post">
Song: <input type="text" name="first"><br>
Score: <input type="text" name="last"><br>
Player Name: <input type="text" name="phone"><br>
Percent: <input type="text" name="mobile"><br>
<input type="Submit">
</form>
calthephenom is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 06-16-2009, 05:51 PM   #9 (permalink)
Design Team Member
 
Redcore's Avatar
 
Join Date: Aug 2007
Location: Jamestown, CA
Posts: 700
OS: Linux Mint 8

My System

Re: PHP help - please help!

Okay, and how does scores.php look?
__________________
Free Resources
PC Protection - Comodo Firewall | AVG Anti-Virus | WinPatrol | Ad-Aware | Spybot S&D | SpywareBlaster |
Web Design/Programming - KompoZer
(Editor) | Paint.NET (Graphic) | GIMP+GIMPShop (Graphic) | FileZilla (FTP Client) | Free Hosting |
Redcore is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 06-16-2009, 05:57 PM   #10 (permalink)
Troubled
 
Join Date: May 2009
Posts: 71
OS: Computer = WXP, Server = linux w/ php 5


Re: PHP help - please help!

Quote:
Originally Posted by Redcore View Post
Okay, and how does scores.php look?
<?
$Song=$_POST['Song'];
$Score=$_POST['Score'];
$Player Name=$_POST['Player Name'];
$Percent=$_POST['Percent'];


mysql_connect(XXXXXXXX,$XXXXXXXXx,$XXXXXXXXX);
@mysql_select_db($database) or die( "Unable to select database");

$query = "INSERT INTO contacts VALUES ('','$Song','$Score','$Player Name','$'Percent')";
mysql_query($query);

mysql_close();
?>

Last edited by carsey; 06-16-2009 at 06:53 PM.
calthephenom is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 06-16-2009, 06:03 PM   #11 (permalink)
Troubled
 
Join Date: May 2009
Posts: 71
OS: Computer = WXP, Server = linux w/ php 5


Re: PHP help - please help!

Quote:
Originally Posted by Redcore View Post
Okay, and how does scores.php look?
it says there is an error

Parse error: syntax error, unexpected T_STRING in /www/uuuq.com/c/a/l/calthephenom/htdocs/scores/scores.php on line 4
calthephenom is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 06-16-2009, 06:10 PM   #12 (permalink)
Moderator, TSF Articles
 
carsey's Avatar
 
Join Date: Aug 2006
Location: Hunwick, Co. Durham England
Posts: 10,671
OS: XP Pro SP3

My System

Send a message via MSN to carsey
Re: PHP help - please help!

You going to need to add a 'id' tag to your form.

HTML Code:
<form action="scores.php" method="post">
Song: <input type="text" name="first" [b]id="name"[/b]><br>
Score: <input type="text" name="last" [b]id="last"[/b]><br>
Player Name: <input type="text" name="phone" [b]id="phone"[/b]><br>
Percent: <input type="text" name="mobile" [b]id="mobile"[/b]><br>
<input type="Submit">
</form>
In scores.php you are going to need to grab the posted data with PHP.

This is done by:

PHP Code:
<?

$name 
$_POST['name'];
$last $_POST['last'];
$phone $_POST['phone'];
$mobile $_POST['mobile'];

?>
That will get the values from the form and make them usable in PHP.


You also need to connect to the database:

PHP Code:
$mysql_server "";
$mysql_user "";
$mysql_password "";
$mysql_database "";
$timeoutseconds 300000


$connection mysql_connect("$mysql_server","$mysql_user","$mysql_password") or die ("<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0; URL=../\">");

$db mysql_select_db("$mysql_database") or die ("<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0; URL=../\">"); 
You will need to add your database credentials in there.

Then insert data into the DB

PHP Code:
mysql_query("INSERT INTO [b]1[/b] 
(name, last, phone, mobile) VALUES('$name', '$last', '$phone', '$mobile' ) "

or die(
mysql_error());  

echo 
"Data Inserted!";

?> 
You then need to make a query to select the data.

PHP Code:
$fetch=mysql_fetch_object(mysql_query("SELECT * FROM `1`")); 
Replace 1 with your table name.

Then to echo the data you need to use the $fetch and the name of the row you want to display.

PHP Code:
<? echo "$fetch->name"?>
<? 
echo "$fetch->author"?>
<? 
echo "$fetch->article"?>
They are just a example and the above is a VERY BASIC script for adding data to forms and is probably liable to SQL injections and exploit. You should ideally strip all HTML and other invalid characters from forms before they are inserted into the database.
__________________

carsey is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 06-16-2009, 06:10 PM   #13 (permalink)
Moderator, TSF Articles
 
carsey's Avatar
 
Join Date: Aug 2006
Location: Hunwick, Co. Durham England
Posts: 10,671
OS: XP Pro SP3

My System

Send a message via MSN to carsey
Re: PHP help - please help!

You going to need to add a 'id' tag to your form.

HTML Code:
<form action="scores.php" method="post">
Song: <input type="text" name="first" id="name"><br>
Score: <input type="text" name="last" id="last"><br>
Player Name: <input type="text" name="phone" id="phone"><br>
Percent: <input type="text" name="mobile" id="mobile"><br>
<input type="Submit">
</form>
In scores.php you are going to need to grab the posted data with PHP.

This is done by:

PHP Code:
<?

$name 
$_POST['name'];
$last $_POST['last'];
$phone $_POST['phone'];
$mobile $_POST['mobile'];

?>
That will get the values from the form and make them usable in PHP.


You also need to connect to the database:

PHP Code:
$mysql_server "";
$mysql_user "";
$mysql_password "";
$mysql_database "";
$timeoutseconds 300000


$connection mysql_connect("$mysql_server","$mysql_user","$mysql_password") or die ("<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0; URL=../\">");

$db mysql_select_db("$mysql_database") or die ("<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0; URL=../\">"); 
You will need to add your database credentials in there.

Then insert data into the DB

PHP Code:
mysql_query("INSERT INTO 1 
(name, last, phone, mobile) VALUES('$name', '$last', '$phone', '$mobile' ) "

or die(
mysql_error());  

echo 
"Data Inserted!";

?> 
You then need to make a query to select the data.

PHP Code:
$fetch=mysql_fetch_object(mysql_query("SELECT * FROM `1`")); 
Replace 1 with your table name.

Then to echo the data you need to use the $fetch and the name of the row you want to display.

PHP Code:
<? echo "$fetch->name"?>
<? 
echo "$fetch->author"?>
<? 
echo "$fetch->article"?>
They are just a example and the above is a VERY BASIC script for adding data to forms and is probably liable to SQL injections and exploit. You should ideally strip all HTML and other invalid characters from forms before they are inserted into the database.
__________________


Last edited by carsey; 06-16-2009 at 06:12 PM.
carsey is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 06-16-2009, 06:24 PM   #14 (permalink)
Troubled
 
Join Date: May 2009
Posts: 71
OS: Computer = WXP, Server = linux w/ php 5


Re: PHP help - please help!

Quote:
Originally Posted by carsey View Post
You going to need to add a 'id' tag to your form.

HTML Code:
<form action="scores.php" method="post">
Song: <input type="text" name="first" id="name"><br>
Score: <input type="text" name="last" id="last"><br>
Player Name: <input type="text" name="phone" id="phone"><br>
Percent: <input type="text" name="mobile" id="mobile"><br>
<input type="Submit">
</form>
In scores.php you are going to need to grab the posted data with PHP.

This is done by:

PHP Code:
<?

$name 
$_POST['name'];
$last $_POST['last'];
$phone $_POST['phone'];
$mobile $_POST['mobile'];

?>
That will get the values from the form and make them usable in PHP.


You also need to connect to the database:

PHP Code:
$mysql_server "";
$mysql_user "";
$mysql_password "";
$mysql_database "";
$timeoutseconds 300000


$connection mysql_connect("$mysql_server","$mysql_user","$mysql_password") or die ("<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0; URL=../\">");

$db mysql_select_db("$mysql_database") or die ("<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0; URL=../\">"); 
You will need to add your database credentials in there.

Then insert data into the DB

PHP Code:
mysql_query("INSERT INTO 1 
(name, last, phone, mobile) VALUES('$name', '$last', '$phone', '$mobile' ) "

or die(
mysql_error());  

echo 
"Data Inserted!";

?> 
You then need to make a query to select the data.

PHP Code:
$fetch=mysql_fetch_object(mysql_query("SELECT * FROM `1`")); 
Replace 1 with your table name.

Then to echo the data you need to use the $fetch and the name of the row you want to display.

PHP Code:
<? echo "$fetch->name"?>
<? 
echo "$fetch->author"?>
<? 
echo "$fetch->article"?>
They are just a example and the above is a VERY BASIC script for adding data to forms and is probably liable to SQL injections and exploit. You should ideally strip all HTML and other invalid characters from forms before they are inserted into the database.
i could handle it all the way up until the MYSQL End
could you help me write the actual php script
html is easy, i just need help w/ mysql/php end
so do i goto my mysql datbase
create a table named " scores" - insert song, score, player name, and percent as a table's contents -and what do i enter for a value
calthephenom is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 06-16-2009, 06:30 PM   #15 (permalink)
Moderator, TSF Articles
 
carsey's Avatar
 
Join Date: Aug 2006
Location: Hunwick, Co. Durham England
Posts: 10,671
OS: XP Pro SP3

My System

Send a message via MSN to carsey
Re: PHP help - please help!

You will need to set the database up and make all the columns or fields you are going to need.

Its always best to make a id field which is set to auto increment when a new record is added.

There are many good guides out there which will help you.

Ive given you a very good idea of how the script will need to be produced so you should be albe to google or use the link Redcore gave you.
__________________

carsey is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 06-16-2009, 06:40 PM   #16 (permalink)
Troubled
 
Join Date: May 2009
Posts: 71
OS: Computer = WXP, Server = linux w/ php 5


Re: PHP help - please help!

Quote:
Originally Posted by carsey View Post
You will need to set the database up and make all the columns or fields you are going to need.

Its always best to make a id field which is set to auto increment when a new record is added.

There are many good guides out there which will help you.

Ive given you a very good idea of how the script will need to be produced so you should be albe to google or use the link Redcore gave you.
please help, i am only 12
calthephenom is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 06-16-2009, 07:18 PM   #17 (permalink)
Design Team Member
 
Redcore's Avatar
 
Join Date: Aug 2007
Location: Jamestown, CA
Posts: 700
OS: Linux Mint 8

My System

Re: PHP help - please help!

Then you're old enough to search for topics with Google

How to make an auto incrementing ID column:
http://trebleclick.blogspot.com/2009...hpmyadmin.html


In basic database design, you want every row to be unique in some way so you can manipulate each row without affecting other rows. This is typically done through a row ID column that is unique.
__________________
Free Resources
PC Protection - Comodo Firewall | AVG Anti-Virus | WinPatrol | Ad-Aware | Spybot S&D | SpywareBlaster |
Web Design/Programming - KompoZer
(Editor) | Paint.NET (Graphic) | GIMP+GIMPShop (Graphic) | FileZilla (FTP Client) | Free Hosting |
Redcore is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -7. The time now is 05:16 PM.



Copyright 2001 - 2009, Tech Support Forum
Home Tips Plus | Outdoor Basecamp | Automotive Support Forum

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85