Trying to add functions to table
Posted on
16th Feb 2014 07:03 pm by
admin
I have this list of characters and I'm trying to figure out what I have to do to put the results of these functions into the table or what not. Keep in mine that these functions are included in a file that is with the bottom file.
Code: function getstatusname($statusid)
{
$query = "SELECT
s.name as status
FROM
efed_list_status as s
WHERE
s.id = '$statusid'";
$result = mysql_query ($query);
while ($row = mysql_fetch_assoc($result))
{
$status=cleanquerydata($row['status']);
return $status;
}
}
function getstylename($styleid)
{
$query = "SELECT
style.name as stylename
FROM
efed_list_styles as style
WHERE
style.id = '$styleid'";
$result = mysql_query ($query);
while ($row = mysql_fetch_assoc($result))
{
$style=cleanquerydata($row['stylename']);
return $style;
}
}
function getalignmentname($alignmentid)
{
$query = "SELECT
alignment.name as alignmentname
FROM
efed_list_alignment as alignment
WHERE
alignment.id = '$alignmentid'";
$result = mysql_query ($query);
while ($row = mysql_fetch_assoc($result))
{
$alignmentname=cleanquerydata($row['alignmentname']);
return $alignmentname;
}
}
Code: <?php {
print '<h1 class=backstage>Character Management</h1><br />';
print "<h2 class=backstage>Characters :: <a href="#" onclick="ajaxpage('addcharacter', 'content'); return false;">Add New</a></h2><br />";
{
$query = "SELECT * FROM efed_bio ORDER BY `charactername`";
$result = mysql_query ( $query ); // Run The Query
$rows = mysql_num_rows($result);
if ($rows > 0)
{
print '<table width="100%" class="table1">';
print '<tr class="rowheading">';
print '<td> </td>';
print '<td> </td>';
print '<td>Character Name</td>';
print '<td align=center width=100>Poser Name</td>';
print '<td align=center width=60>Style</td>';
print '<td align=center width=60>Alignment</td>';
print '<td align=center width=60>Status</td>';
print '</tr>';
// Fetch and print all records.
$i = 0;
$current_row = 0;
while ( $row = mysql_fetch_array ( $result, MYSQL_ASSOC ) ) {
$sClass = 'row2';
if ($i ++ & 1) {
$sClass = 'row1';
}
printf ( "<tr class="%s">", $sClass );
print "<td valign="top" align=center width=35><a href="#" onclick="ajaxpage('editcharacter', 'content'); return false;">Edit</a></td>";
print "<td valign="top" align=center width=25><a href="#" onclick="ajaxpage('bio', 'content'); return false;">Bio</a></td>";
printf ( "<td valign="top">%s</td>", $row [charactername] );
printf ( "<td align="center" valign="top">%s</td>", $row [posername] );
printf ( "<td align="center" valign="top">%s</td>", $row [style] );
printf ( "<td align="center" valign="top">%s</td>", $row [name] );
printf ( "<td align="center" valign="top">%s</td>", $row [name] );
print '</tr>';
}
print '</table>';
}
else
{
print '<span>There are characters.</span><br />';
}
print '<br />';
returnmain();
}
}
?>
No comments posted yet
Your Answer:
Login to answer
72
49
Other forums
tell csv import script to ignore blank rows?
Hi i have the below script but i get an error if a row is blank ie a return in the csv file at the e
passing data from one page to another
hey guys
i have the follwoing code to get information from one page and place on another:
the problem with str_replace
$str="hahahahahahahahahahahahahaha";
$nn=1;
$str=str_replace('ha','MyGod',$str,$nn);
How to convert this array to string
I am having problems converting this array to a string
using print_r($val[1]); I get:
Code: [
search function
HI guys,
if anyone could point us in the right direction of how to do this, or provide some t
Looping Problem
I've got a client that has a database with about 200 events at any given time. I'm trying to loop t
help need on ob_start()
Hi
I am a newbie in php, I have a code
Line number On/Off | Expand/Contract <?phpo
PHP4 to PHP5 Conversion
Hi Everyone,
I am working on a site that is built up on PHP4 and each page is being started f
iterating through an array and escape each value independently.
I have a set up where the variable being escaped is an array and it needs to be iterated and escaped
Recode Abap Dynpro into Web Dynpro
Hi All,
A client has asked us to look at rearchitecting a custom transaction that was developed