Welcome! Log In Create A New Profile

Advanced

The fixtures page

Posted by Mariuspienaar 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
The fixtures page
February 18, 2013 09:29AM
Good day!

In the tutorial letter it shows some sample code of pages,for example the fixture page show some code with if/else statements.Do we really need to work with those if/else statements or can we do our own code here,my page is working correctly without any if/else statements.otherwise i must recode my whole fixture page.

Thanks
avatar
Mac
Re: The fixtures page
February 18, 2013 11:46AM
You can code any way you want
Re: The fixtures page
April 18, 2013 05:20PM
Hi Mac,

Can you please give me some hint on where I may be doing something wrong on the following script, because it gives me an error : undefined index error.

Language: PHP
include "connect.php";   //making a query $query = "SELECT * FROM fixtures";   $results = mysql_query($query);     echo "<table>";   echo "<tr><th>OPPONENTS</th><th>DATE</th><th>VENUE</th><th>ACTION</th></tr>";   while ($rows = mysql_fetch_array($results)) { $fixture_id = $rows[';FIXTURE_ID';]; $opponents = $rows[';OPPONENTS';]; $date = $rows[';DATE';]; $venue = $rows[';VENUE';];   echo "<tr><td>$opponents</td><td>$date</td><td>$venue</td><td><a href=fixtures.php?fixture_id=$fixture_id>Delete</a></td><td><a href=fixtures.php?fixture_id=$fixture_id>Update</a></td></tr>"; }   echo "</table>";   $fixt_id = $_GET[';fixture_id';];
Re: The fixtures page
April 18, 2013 05:51PM
No worries Mac,

I got it sorted...

following is the write code: spinning smiley sticking its tongue out

Language: PHP
//connection to external database file include "connect.php";   //making a query $query = "SELECT * FROM fixtures";   $results = mysql_query($query);     //$delete = ""; //$update = "";   echo "<table>";   echo "<tr><th>OPPONENTS</th><th>DATE</th><th>VENUE</th><th>ACTION</th></tr>";   while ($rows = mysql_fetch_array($results)) { $fixture_id = $rows[';FIXTURE_ID';]; $opponents = $rows[';OPPONENTS';]; $date = $rows[';DATE';]; $venue = $rows[';VENUE';];   echo "<tr><td>$opponents</td><td>$date</td><td>$venue</td><td><a href=fixtures.php?fixture_id=$fixture_id>Delete</a></td><td><a href=fixtures.php?fixture_id=$fixture_id>Update</a></td></tr>"; }   echo "</table>";   if(isset($_GET[';fixture_id';])) {   $fixt_id = $_GET[';fixture_id';]; }
Sorry, only registered users may post in this forum.

Click here to login