Jump to content

SneakyMax

Members
  • Posts

    11
  • Joined

  • Last visited

    Never

Contact Methods

  • Website URL
    http://www.thereviewpalace.com

Profile Information

  • Gender
    Not Telling

SneakyMax's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Are you sure? If you go to http://www.thereviewpalace.com/admin.php?page=main then click on 'old news' then on the bottom one click the middle picture you get the error? You shouldn't I'm not logged in and I can do just those things, nothing else Or, you can go to http://www.thereviewpalace.com/admin.php?page=news&method=edit&id=5 and you will go directly to the editing page of the news post that won't work
  2. Okay, I guess a second set of eyes to see if they can isolate the problem would be good. I may get a bit of spammyness but I can easily revert it back. I saved all of the other news posts that worked (eventually) UrL: http://www.thereviewpalace.com/admin.php?page=main You will have access only to Old News, and in there, editing (adding might give more spam, if there's a less spam way to tell you I will let you add ones). For the list of news posts the newest one (the one that won't work) is at the bottom. I'm going to get spam. I'm using htmlentities though so no malicious code. Also, yay for advertisement!
  3. I thought of that, but I have a phpbb forum, and it's adding new posts just fine. And I've only used like 20mb out of 30gb
  4. It's basically a Mysql remake of Mysqli that I mostly got from a book, then tuned to what I needed. [code]<?php $query="UPDATE rp_news SET text=:1 WHERE id=:2"; $db->prepare($query)->execute($_POST['text'],$id); ?>[/code]
  5. I'll try those thanks. EDIT: Okay, I cleared the cache then refreshed it and it disappeared. Then I tried again (editing to say edit and going there), it was there, I cleared the cache, and it was still there. I then edited it (it disappeared after a while), and immediately checked the database. It's right there. Then I went to the news page, and checked the database again. Still there This is just weird...and it just disappeared again EDIT 2: And this time it's staying. Both on the page and in the database. And it will probably be gone again by the time I'l done writing this. I'm really stuck on this, could it be the database not liking it or my hosting not liking it? It's just weird
  6. I'm using a hosting provider, they might have cronjobs on there. I could ask them And, no, they're all MyISAM tables
  7. It doesn't really happen immediately after updating the text. It's really weird and sporatic. And I can't find when it happens. I will go to it many times, and other pages, and it will be fine. Then maybe 5 minutes later it's gone. It's just a really weird thing. I'll do some more tests. Thanks for your help EDIT: It's really weird, I can go to almost every single page (and script) on my site and the news post stays there. Probably in 5 minutes it will disappear again. Does the database not like it? EDIT2: Yep, right when I finished writing the edit, I went back and refreshed the page. And if course, it was gone again.
  8. Nope, I don't think so. The only page that includes it is admin.php, and that's so I don't have to access the script directly. The only time $_GET['done'] is used is in my four edit.php's (one for each thing that can be edited). Thanks though that would make sense. If it helps, the format for rp_news: 'id' smallint(10) auto_increment 'text' text 'date' datetime Could it be possible that someone is messing with the database?
  9. This problem has been bugging me for a while now, and I don't have the slightest clue what migh be causing it. It might not even relate to my php. Ok, I have a news page on my website, which gets all the news posts from a mysql database and lists them. Then I have a bunch of admin pages, one of which I can add, edit, view, and delete news posts. I believe the problem is something with the old news editing file, but I've checked it. The problem is that I will edit the file, then go to the news page. It will work fine, the news post was edited and everything. I refresh the page. Still there. Then I click on links that lead me to the same page. Still there. Then I wait a couple minutes. Try going to the news page, and the text I changed for the news post is just gone. It shows the time and then blank. Looking in to it, the text section of the part of it in the database is just gone. Blank. Everything else about the value is there though. Date, id. Here is the script for editing it (edit.php): [code]<?php include_once('includes.php'); $db=new DB_Mysql(); $scp=new Scp(); $rp=new Rp(); $scp->check_credentials(3); $id=$_GET['id']; $html=''; switch($_GET['done']){ case 1: $query="UPDATE rp_news SET text=:1 WHERE id=:2"; $db->prepare($query)->execute($_POST['text'],$id); echo($_POST['text']); $rp->set_quick("Update complete<br> <a href='http://www.thereviewpalace.com/admin.php?page=news&method=all'>Back</a> "); break; default: $query="SELECT * FROM rp_news WHERE id=:1 LIMIT 1"; $row=$db->prepare($query)->execute($id)->fetch_assoc(); $html.="<form method='POST' action='http://www.thereviewpalace.com/admin.php?page=news&method=edit& id=".$row['id']."&done=1' name='editform'><tr> <td> <textarea name='text' rows='30' cols='100'>".stripslashes($row['text'])."</textarea></td></tr><tr><td> <input type='submit' value='Submit' name='submit'></form></td></tr><tr><td> <a href='http://www.thereviewpalace.com/admin.php?page=news&method=view&id=".$id."'> <img src='http://www.thereviewpalace.com/images/icon_view.jpg'></a> <a href='http://www.thereviewpalace.com/admin.php?page=news&method=delete&id=".$id."'> <img src='http://www.thereviewpalace.com/images/icon_delete.jpg'></a> </td> </tr>"; $mainhtml="<big>Here is the page requested.<br> <a href='http://www.thereviewpalace.com/admin.php?page=news&method=all'>Back</a><br><br> <table border='1' cellpadding=3> ".$html." </table>"; $rp->start(); $rp->set_page_text($mainhtml); $rp->set_text(); $rp->end(); } ?>[/code] I know I don't [i]need[/i] a switch statement but I've found them useful, especially for $_GET variables And this is every time the table rp_news is accessed in every single one of my scripts: index.php (109): $sql="SELECT * FROM rp_news ORDER BY date DESC"; index.php (173): $sql="SELECT * FROM rp_news ORDER BY date DESC"; index.php (184): $sql="SELECT * FROM rp_news ORDER BY date DESC"; add.php (12):      $query="INSERT INTO rp_news (text,date) VALUES (:1,now())"; edit.php (14):      $query="UPDATE rp_news SET text=:1 WHERE id=:2"; edit.php (23):      $query="SELECT * FROM rp_news WHERE id=:1 LIMIT 1"; all.php (12):        $query="SELECT id, date FROM rp_news ORDER BY date ASC"; delete.php (14):    $query="DELETE FROM rp_news WHERE id=:1 LIMIT 1"; add, edit, all, and delete are for the news posts. I use an inclusion system and folders. As it says, only edit.php updates rp_news. But that still doesn't explain the huge delay before it just erases itself. What could be causing this?
  10. No idea there was an INNER JOIN, looks like what I'm looking for thanks a ton. Edit: Works [i]perfectly[/i] thanks a ton!
  11. Okay, this is my first post so don't go too hard on me... I've been using php for about 2 months now, got the basics. My problem is that for the thing that I am making online, it uses two different mysql tables to 'simplify' things, so I don't have too many columns. The first table, for my nation simulation, has these things: nation id, first name, last name And the second table has these: nation id population I have a script that lists all of the nations, and in order of different things. Such as nation id and nation name, using "SELECT * from [table1] ORDER BY 'nationid' ASC To order by nation id The problem is I don't know how to order it by population, since it's in a different table. The nation ids in table 2 go with the nation ids from table 1, but I don't know how to get the order of population from table 2, then use that order in table 1 to get the name. Hope it's not too confusing...it might have to do with sql, or mysql_fetch_array probably.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.