Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Need help finding variables
Old 06-06-2006, 01:40 AM Need help finding variables
Average Talker

Posts: 20
Trades: 0
The code is here

PHP Code:
// this function views logs
   
function viewLogs($page) {

      echo(
"<p align=left><b><i>Logs</i></b><hr></p><center><table border=0 width=100% cellspacing=1 cellpadding=2>");

      
$result mysql_query("SELECT COUNT(*) FROM log");
      
$count mysql_fetch_array($result);
      
$count $count[0];

      
$logsperpage 50;

      
$num_pages = ($count $logsperpage) + 1;
      
$limit $logsperpage * ($page 1);

      
$result mysql_query("SELECT * FROM log ORDER BY id DESC LIMIT $limit$logsperpage");
      while( (
$row mysql_fetch_array($result) ) ) {
         
extract($row);

         echo(
"<tr><td bgcolor=#000000>");

         
$longlog "$date1 $action";
         
$reason bbc2html($longlog);
         
$thelog "<a href=console.php?p=OneLog&log1=$id$reason </a>";

         echo
"<font size='1' color='white'> $thelog</td>";
      }
      echo
"<tr><td><font size='1' color='white'>Page:";
      for(
$i 1$i <= $num_pages$i++) {
         echo(
"<a href=console.php?p=ViewLogs&page=$i>$i</a>");
      }
      echo(
"<br><font size='1' color='white'> Current Page: <font color='green'>$page </font>
   <br><font size='1' color='white'> Number of Logs Per Page: <font color='green'>
$logsperpage</font></table></center>");
   } 
// end viewLogs 
Where are the variables so i can rename them to these? My View Logs page isn't working so obviously there are tables wrong. If someone could I would want the code pointed out where you change them. My view logs page isn't working so i'm obviously doing it wrong:

id
action
reason
date1
Arez2 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-06-2006, 03:50 AM Re: Need help finding variables
0beron's Avatar
Defies a Status

Posts: 1,832
Location: Somewhere else entirely
Trades: 0
The variables are the things starting with a $ sign. If you rename these then there won't really be any effect, since it is the values they contain and not their name that control what the script does (by and large). If the page displays a list and you want to rename things in the list, you will need to change the code that displays the list.

If you could tell us a little more about what id, action, reason and date1 are meant to be, then perhaps we can help you out more effectively.
__________________
UPDATE 0beron SET talkupation = talkupation + lots WHERE post = 'helpful';

Please login or register to view this content. Registration is FREE
(aka MSN handwriting for forums)
0beron is offline
Reply With Quote
View Public Profile Visit 0beron's homepage!
 
Old 06-06-2006, 06:24 PM Re: Need help finding variables
Average Talker

Posts: 20
Trades: 0
id
action
reason
date1

are the table structure for "log"

CREATE TABLE `log` (
`id` smallint(255) NOT NULL auto_increment,
`action` varchar(255) NOT NULL default '',
`reason` varchar(255) NOT NULL default '',
`date1` varchar(255) NOT NULL default '',
PRIMARY KEY (`id`)
) TYPE=MyISAM AUTO_INCREMENT=1 ;

My View Logs function does not work since the variable names are wrong. I need help replacing them with id, action, reason and date1.
Arez2 is offline
Reply With Quote
View Public Profile
 
Old 06-16-2006, 01:52 AM Re: Need help finding variables
Average Talker

Posts: 20
Trades: 0
WHY WHY
Arez2 is offline
Reply With Quote
View Public Profile
 
Old 06-16-2006, 02:02 AM Re: Need help finding variables
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
JAMISONTUNES
Posts: 2,918
Name: Keith Marshall
Location: Connecticut
Trades: 0
You need to alter your table field 'id':

Code:
ALTER TABLE `log` CHANGE `id` `id` INT( 11 ) NOT NULL AUTO_INCREMENT
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Need help finding variables
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.31343 seconds with 12 queries