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
Old 09-03-2008, 09:17 AM Stale data?
Sleeping Troll's Avatar
Ultra Talker

Posts: 351
Name: Butch Begy
Trades: 0
This is a simple serverside ajax script, all I will say about it is that the code in red echoes the values to the page for verification.

Code:
 
<?php
$conn = mysql_connect("xxx","xxx","xxx"); 
mysql_select_db("xxx",$conn);
$Name = $_GET["Name"];
$SQL = "Select * From Categories Where Title = '$Name'";
$result = mysql_query($SQL);
$row=mysql_fetch_array($result);
if ($row[2] = "Enabled")
 {
  $SQL = "Update Categories Set Enable = 'Disabled' Where Title = '$Name'"; 
 }
else
 {
  $SQL = "Update Categories Set Enable = 'Enabled' Where Title = '$Name'"; 
 }
echo("$row[2], ");
echo($SQL);
mysql_query($SQL);
echo " <table width='100%' border='0'>";
$SQL = "Select * From Categories Order By CategoryID";
$result = mysql_query($SQL);
while($row = mysql_fetch_array($result))
{
 echo (" 
   <tr> 
    <td width = '160' height = '28'><div class = 'style8' align = 'left'><a href = '#' title = 'Rename Category' onClick = EditCatName('Categories','$row[1]')>$row[1]</a></div></td>
    <td width = '80' ><div class = 'style8' align = 'right'><a href = '#' title = 'Enable/Disable' onClick = ToggleCatEnable('Categories','$row[1]')>$row[2]</a></div></td>
   </tr>
   ");
}
echo "</table>";
?>
Please take a look at code then visit the site and see the problem with toggling Enable/Disable, looks like cahed data to me, but I am somewhat new to php.

http://trollnest.com/bragflags/Administration/default.php
Sleeping Troll is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 09-03-2008, 02:20 PM Re: Stale data?
Sleeping Troll's Avatar
Ultra Talker

Posts: 351
Name: Butch Begy
Trades: 0
Nope, just stale programming, if ($row[2] = "Enabled") SB if ($row[2] = = "Enabled")
Sleeping Troll is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Stale data?
 

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.09560 seconds with 12 queries