I want to re-design a simple website I use for our charity. Part of the current site uses an SQL database to show activities going on a daily basis. It also uses tables in the database to populate fields with member information etc. Is there a tutorial which shows how I can create fields on the web page and attach data to them via say cpanel. At present I use a php wrapping to "include" various aspects I want visable to users of the site. For example this code:
<?php
//connection to the database
$dbhandle = mysql_connect($hostname, $username, $password)
or die("Unable to connect to MySQL");
//echo "Connected to MySQL<br>";
//select a database to work with
$selected = mysql_select_db("eachfrie_Events",$dbhandle)
or die("Could not select eachfrie_Events");
/// query db and loop through rows example
//use the ternary operator to find the year from the post value or set it to the current year
$year = (is_numeric((int)$_POST['year'])) ? ((int)$_POST['year']) : date("Y");
$info1 = "Please select a financial year from the drop down box to display the programme year required:";
$query = mysql_query("SELECT * FROM tblEvents WHERE FinancialYear =$year ORDER BY EventDate;") or die(mysql_error());
//$query = mysql_query("SELECT * FROM tblEvents WHERE FinancialYear =$year ORDER BY EventDate;");
//$query = mysql_query("SELECT * FROM tblEvents WHERE FinancialYear =2010 ORDER BY EventDate;");
//$table = "<table border=\"1\">\n";
$table = "<form method=post><table border=\"1\" cellspacing=\"10\" body bgcolor=\"#AABBCC\" Align=Center>\n";
$tableHead = "<tr>
<th>Event</th>
<th>Location</th>
<th>Status</th>
<th>Type of Event</th>
<th>Date</th>
<th>Start Time</th>
<th>End Time</th>
<th>Coordinator</th>
<th>Comments</th>
<th>Funds Raised</th>
<th>Financial Year
<select name='year' onchange='form.submit();'>
<option>2009</option>
<option>2010</option>
<option>2011</option>
<option>2012</option>
<option>2013</option>
<option>2014</option>
<option>2015</option>
<option>2016</option>
<option>2017</option>
<option>2018</option>
<option>2019</option>
<option>2020</option>
</select>
</th>
</tr>\n";
while($row = mysql_fetch_array($query)){
$tablerow .= "<tr>
<td>".$row['eventname']."</td>
<td>".$row['eventlocation']."</td>
<td>".$row['eventstatus']."</td>
<td>".$row['eventtype']."</td>
<td>".$row['eventdate']."</td>
<td>".$row['starttime']."</td>
<td>".$row['endtime']."</td>
<td>".$row['coordinator']."</td>
<td>".$row['comments']."</td>
<td>".$row['fundsraised']."</td>
<td>".$row['financialyear']."</td>
</tr>\n";
}
$tableEnd = "</table></form>\n";
?>
retrieves event data from the database and generates a table to show the associated records. Can I do this as an insert between the HTML code fragments or is this not possible. If I can't use databases with WebEasy it is of little or no benefit to me. Can anyone help please?
Facebook
Twitter
LinkedIn
RSS
1 Citizens Answers
Arthur K. says:
Hello Beeky,
Unfortunately, WebEasy does not create databases or work with databases. It is a front-end template based html page builder.
You can try using the HTML CODE FRAGMENT feature to insert php coding, however I do not believe it would work.
You would also need to change the html file type of the document from .htm to php if I am not mistaken.
Votes
Post your comment
You might be interested in these related contributions
WebEasy 9
I downloaded WebEasy 9 and made some changes to my website pages, saved them and have been trying to publish my updated website. But for some reason it says it updated the site but now it shows it is ...
in Business, by Linda Breyfogle
Jan 20 2012, 8:15pm
WebEasy 9
Avanquest USA Case # 00099187: [ ref:_00D60IlZ8._50060HPXR6:ref ] Hello Jason, I've had a problem with my WebEasy 8 to WebEasy 9 Document(Pages turning BLACK). Ross Winn has informed me on ...
in Internet & Networking, by Howard Little
Mar 21 2012, 1:44pm
Installing WebEasy 9
When downloading WebEasy 9, I'm told in a dialog box that I already have WebEasy (8) and will have to uninstall it. If I do that, what happens to the files and websites I created with WebEasy 8? Will ...
in Internet & Networking, by Laura Wharton
Jul 12 2012, 6:54pm
install WebEasy 9
I have a web site that was created using Web Easy 8. I have just received WQeb Easy 9. The install of Web Easy 9 says to first uninstall Web Easy 8 then install Web Wesy 9. What is the impact on my we...
in Internet & Networking, by ken cooper
Jan 14 2012, 11:03am