I really have no idea where to start for this, as i'm VERY new to scripting, but i do have intermediate skills at html, so i thought i'd try and get a nudge in the right direction from a help site.
I'm currently making a website where I'll need to have a rankings table of teams for an online computer game league.
I'll put this table in my .htm file, as I want it to be integrated in the page, and look just like a regular table would.
but, I want to be able to externally update the data in this table, so I don't have to change the .htm file after every match, updating the teams, their positions on the table and the rest of the data.
the primary aim of this method for me, is for ease of use.
i would also like this external file to be able to sort the positions of teams on the table for me, based on the points this team has won.
so, does anyone know of a format of file or external source i could use? like PHP or another script?
and how i would achieve this goal.
cheers.
rowan.
16 1911
What do you have available PHP,ASP, etc... I'm going to move this thread to the appropriate forum.
umm, ive got mySQL and PHP4/PHP5 available to use in the hosting plan, but i just lack any knowledge of coding in them.
which one do you think would be more appropriate? for the basic aims i'm trying to achieve.
PHP4/PHP5 are the versions the main thing is that you can run PHP on your site. I'm going to move this thread to the PHP forum.
First you have to make a choice between storing the data in a flat text file or in a MySQL database.
Both solutions can be externally updated via a grid script and both can be read, sorted and stored into your html page.
MySQL is easier to handle and program, but has more server overhead. A flat file is more difficult (column positions etc.) to program but has less overhead.
So it's up to you to first decide how and where you want your data to be stored.
Ronald :cool:
well i think as a complete beginner i should use mySQL, if its easier.
i'll only need a maximum of 72 text fields in the table, so there shouldn't be too much server overhead, right?
so if i'm to use mySQL, could you point me to a decent tutorial for integrating it into a table in html?
i havent downloaded mySQL though, and havent a clue what to do once i have got it, anyway.
thanks for all the help in advance.
thanks.
well... currently, im on the freewebmasterhelp tutorial.
i've downloaded mySQL, gotten an account, and am trying to set up phpMyAdmin, but the setup.php file won't open in IE or firefox... and i need it to. otherwise i cant use phpMyAdmin.
what do you suggest i do?
I'd suggest that you forget about phpMyAdmin for now and setup your MySQL server first using the command line interface. You'll learn more about Mysql and the SQL statements using that. If not, you can also execute SQL via a server script, like PHP.
First get your server setup right, then worry about the user interface like phpMyAdmin.
Ronald :cool:
well i really have no idea what i'm doing, and the server won't set up properly.
so, the other option, a flat text file.
how do i integrate that with my html file, and will it allow automatic sorting based on the information in the flat text file?
Atli 5,058
Expert 4TB
Hi there
I have another, extreeemly simple solution, wich I far from being as good as anything using any form of a database.
In your html file Im assuming you have a table and that you want to add a tr row to the end of it before you close it?
If so you could add a html comment before you close the table and have a php file replace the comment with a new row.
Wich could be done somewhat like this...
[PHP]// Read the file
$filePath = "myhtml.html";
$fh = fopen($filePath, "r");
$contents = fread($fh, filesize($filePath));
fclose($fh);
// Change the contents
$newRow = "
\n<tr> <td> Somedata </td><td>". $_POST['fieldname'] ."</td></tr>
\n<!-- what? -->";
$output = str_replace("<!-- what? -->", $newRow, $contents);
// Overwrite the file with new content
$fh = fopen($filePath, "w");
fwrite($fh, $output);
fclose($fh);[/PHP]
This php code would be the target of a html <form> wich would provide the <input> field named 'fieldname'.
You would obviously have to edit to $newRow variable in the PHP to create the output you need, and create the html form that would call the php.
Hope this helps you :)
thanks for the help, but, haha, i dont think u realise how much of a beginner i am.
because i don't understand that.
but i do want a database solution, something that will allow sorting and mathematical problems in it.
so im trying to get mySQL working again, ill keep trying, and hopefully i'll get it in the end.
ill post again if i run into any problems.
Atli 5,058
Expert 4TB
I see :P
I think MySQL comes with a ms installer so it really should be no problem.
This here is a file I created for myself, instructions on how to manually install PHP on Apache server with MySQL. How to manualy install PHP on Apache server with MySQL with Win XP
Note: this is based on a rather old version but should work fine tho
well finally i've managed to get it working for the most part,
but how do I sort the table by a variable?
i can sort it in phpmyadmin, but once i put it in the .php file, its no longer sorted
In order to answer that you must show the PHP and the MySQL code you use to extract the data from the db.
Ronald :cool:
well here's the code in my .php file. - <? $hostname = "p3smysql17.secureserver.net"; // The mySQL DB server.
-
$username = "acssl_table"; // The username you created for this database.
-
$password = "Victoria3"; // The password you created for the username.
-
$usertable = "table"; // The name of the table you made.
-
$dbName = "acssl_table"; // This is the name of the database you made.
-
-
MYSQL_CONNECT($hostname, $username, $password) OR DIE("DB connection unavailable");
-
@mysql_select_db( "$dbName") or die( "Unable to select database");
-
?>
-
<?
-
//error message (not found message)begins
-
$XX = "No Record Found, to search again please close this window";
-
//query details table begins
-
$query = mysql_query("SELECT * FROM `table` LIMIT 0, 30 ");
-
while ($row = @mysql_fetch_array($query))
-
{
-
$variable1=$row["team"];
-
$variable2=$row["played"];
-
$variable3=$row["won"];
-
$variable4=$row["drawn"];
-
$variable5=$row["lost"];
-
$variable6=$row["for"];
-
$variable7=$row["against"];
-
$variable8=$row["difference"];
-
$variable9=$row["points"];
-
//table layout for results
-
-
print ("<tr>");
-
print ("<td width='150'><span class='BodyTable'>$variable1</span></td>");
-
print ("<td width='50' align='center'><span class='BodyTable'>$variable2</span></td>");
-
print ("<td width='50' align='center'><span class='BodyTable'>$variable3</span></td>");
-
print ("<td width='50' align='center'><span class='BodyTable'>$variable4</span></td>");
-
print ("<td width='50' align='center'><span class='BodyTable'>$variable5</span></td>");
-
print ("<td width='50' align='center'><span class='BodyTable'>$variable6</span></td>");
-
print ("<td width='50' align='center'><span class='BodyTable'>$variable7</span></td>");
-
print ("<td width='75' align='center'><span class='BodyTable'>$variable8</span></td>");
-
print ("<td width='75' align='center'><span class='BodyTable'>$variable9</span></td>");
-
print ("</tr>");
-
}
-
//below this is the function for no record!!
-
if (!$variable1)
-
{
-
print ("$XX");
-
}
-
//end
-
?>
and these are screenshots of the database,
didnt think theyd be useful, but I really don't know what you're looking for, so:
here's one of the table
and one of the data
oh, and could someone explain how to do that in phpMyAdmin 2.7
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Marc |
last post by:
Hi all,
I have a problem with managing the interchange between COM/Excel and
Python if the user closes the workbook externally.
Everything works fine as long as the user only uses the exit...
|
by: Fredrik/Sweden |
last post by:
Hi folks !
got this problem...
i have a table 'Accounts' in my database, which contains a bunch of
users. From the main menu i choose "edit user" and all users in the db
are presented in a table....
|
by: revolnip |
last post by:
As attached is the code :
<% Option Explicit
dim lngTimer
lngTimer = Timer
%>
<!--#include file="Connect.asp" -->
<!--#include file="Settings.asp" -->
<!--#include file="Common.asp" -->
|
by: Lauren Quantrell |
last post by:
In VBA, I constructed the following to update all records in
tblmyTable with each records in tblmyTableTEMP having the same
UniqueID:
UPDATE
tblMyTable RIGHT JOIN tblMyTableTEMP ON...
|
by: Eugene |
last post by:
Summary:
----------
Updates against UNION ALL view does't do branch elimination, but
rather reads all the branches (partitions).
The case scenario(DB2 V8.1.4a ESE, AIX 5.2):...
|
by: Ian Davies |
last post by:
Hello
I have seen some tutorials to put a update a counter field in a record. I
have the counter field in a table that also has a field for a path to file.
I display the records in a table on...
|
by: Rudy |
last post by:
Hello all!
I'm working in vb/ado.net I want to to have a message box pop up based on a
result of a update on a SQL table. How do I do that so it automaticly pops
up after the update is...
|
by: Miro |
last post by:
I will ask the question first then fumble thru trying to explain myself so i
dont waste too much of your time.
Question / Statement - Every mdb table needs a PrimaryKey ( or maybe an
index - i...
|
by: Shawn T |
last post by:
I have an application with a page that has a web user control
When I call that page that has this user control, locally (http://
localhost/ApplicationX/default.aspx) and also externally ie...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
| |