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>&nbsp;</td>';
print '<td>&nbsp;</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 Like 49 Dislike
Previous forums Next forums
Other forums

Error in Configure System Landscape Directory phase
Hi

We are getting the error in Configure SLD phase ( 41 of 44 phase).

Please f

Why is my row count 0?
Here's the MySQL query i'm running. It basically pulls data from 2 tables based on some data passed.

Execure stored procedure on a timer
Can someone tell me an easier way to execute a stored procedure on a timer? I am using Oracle 10g R

Add_Months not Easy to Understand
Oracle is number 1, very fast and very easy. But....
OK, I think but have a problem, only 1 pro

$variable = $variable
Hello

Sorry if this is a really simple question but I have run out of ideas. Is there a reall

Can php detect connection speed and thereafter swap out elements?
No code to post, lads, yet. Just looking for a yay or nay at this stage:

Can a php script be

pointer 102 question
I read a book
1
2
3
4
5
6
7
8
9
10
11
12
int main() {

Staff Induction System - No idea where to go from here!!!
Hi there, I'm pretty new to PHP and Mysql so could really do with being pointed in the right directi

Help? Need help on project with templates involving mysql and php.
I'm having a hard time explaining what I want but basically here is what I have in place:

-Da

Help with PHP Email Script
Hi guys,

I'm a newbie to php and need help with the script below:

At the moment when I

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash