Jump to content

alen

Members
  • Posts

    64
  • Joined

  • Last visited

    Never

Everything posted by alen

  1. I made this script that's supposed to delete a row when I click on one of the news titles.. I added two threads, Hello world and Test. I simply want to delete Test. But when I click on the link nothing happends. Here's the code: http://anigma.sitees.com/delete.txt
  2. alen

    Parse error

    How would I put that together with the rest of the code?
  3. alen

    Parse error

    Are we on the same page on this?
  4. alen

    Parse error

    That was better, but... I want to have links on the rediger.php site to each post. Let's say this is the page: rediger.php : Random test (the first post i posted) Whatever (the second) etc... And then I want to make each title to a link like rediger.php?id=1 (which is Random test since it was the first post i posted), and then I click on the title and then I would be able to edit/save the content.
  5. alen

    Parse error

    Yes I have a field/column for the date, but I got this, You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY date DESC LIMIT 10' at line 1
  6. alen

    Parse error

    This is how my edit script looks like right now, http://anigma.sitees.com/rediger.txt and http://anigma.sitees.com/lagre.txt I keep getting a notice error.. [b]Notice:[/b] Undefined index: id in [b]rediger.php[/b] on line [b]8[/b] Should I just get this away with, error_reporting(E_ALL ^ E_NOTICE); ?
  7. alen

    Parse error

    How would I make the newest posts be listed on the rediger.php site? From 1 to 10..
  8. alen

    Parse error

    Of course I have a database named nyheter.. and the table is named news.. However, the query should be getting something!
  9. alen

    Parse error

    I tried rediger.php?id=1 and then I got this: Table 'nyheter.nyheter' doesn't exist Where do I ask for the nyheter.nyheter table?
  10. alen

    Parse error

    Now I get: Notice: Undefined index: id in path/path/rediger.php on line 8 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
  11. I'm making a news management script! So far I have managed to make the script add news, so that I can view it on the index page. Now I've started with the edit part. First off I got an error ... then I added a mysql_error to check it. This is the result of the new error: [b]Parse error:[/b] parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in [b]/path/path/rediger.php[/b] on line [b]8[/b]. I can't seem to find any extra spaces in the script, so I don't think that's causing the error. Here's my code, http://anigma.sitees.com/rediger.txt and http://anigma.sitees.com/lagre.txt It consist's of two parts, firstly I have to extract the news from my database, and secondly I have to display this data. I have chosen to display the latest 10 newest posts.
  12. I'm back again.. I added a mysql_error to find out what the problem was. So this is what it returned, You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1. I didn't actually get that, but could someone translate? Here's my code, http://anigma.sitees.com/rediger.txt and http://anigma.sitees.com/lagre.txt It consist's of two parts, firstly I have to extract the news from my database, and secondly I have to display this data. I have chosen to display the latest 10 newest posts.
  13. Nevermind! I'll do it all over again. Think I may have done something wrong, and I attend to get it right next time. I want to thank you all for the help and support I got. Sincerely, anigma
  14. Ok, now I get: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\Program Files\Server\public_html\news\edit_process.php on line 17
  15. Look for yourself: [code]<?php error_reporting(E_ALL ^ E_NOTICE); include('config.php'); $db=mysql_connect($db_host,$db_user,$db_pass); mysql_select_db ($db_name) or die ("Cannot connect to database"); if(isset($_GET['id'])) { $id = $_GET['id']; echo "<!-- Your query was selected with a get method -->"; $query = mysql_query("SELECT * FROM news WHERE id=$id") or die(mysql_error()); } if(isset($_POST['id'])){ $id = $_POST['id']; echo "<!-- Your query was selected with a post method -->"; $query = mysql_query("SELECT * FROM news WHERE id=$id"); or die(mysql_error()); } while($r=mysql_fetch_array($query)) { $nid = $r['id']; $title = $r['title']; $news = $r['news']; echo "<form name='edit_process.php' method='post' action='edit_save.php?id=".$nid."'>   <p>Title :     <input type='text' name='title' value='".$title."' />   </p>   <p>News :</p>   <p>     <textarea name='news' cols='40' rows='6'>".$news."</textarea>   </p>   <p>     <input type='submit' name='Submit' value='Save' />   </p> </form>"; } ?>[/code}[/code]
  16. Anyway, I did what you told... and I got this back, Parse error: parse error, unexpected T_LOGICAL_OR in C:\Program Files\Server\public_html\news\edit_process.php on line 14
  17. Yes I have. It should be getting something. But how come the guy that made the script got it to work with the code written on this page, http://www.oxyscripts.com/item-408.html So there is a misspelling somewhere in the code?
  18. Nevermind the Notice error, cleared that one.
  19. the code gave me these errors; Notice: Undefined variable: query in C:\Program Files\Server\public_html\news\edit_process.php on line 16 Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\Program Files\Server\public_html\news\edit_process.php on line 16
  20. I'm feeling we're making progress; Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\Program Files\Server\public_html\news\edit_process.php on line 15 No news items.
  21. One last error; Parse error: parse error, unexpected T_VARIABLE in C:\Program Files\Server\public_html\news\edit_process.php on line 19
  22. I tried the code bljepp69 gave me, and it got me another error; [b]Notice:[/b] Undefined variable: query in [b]C:\Program Files\Server\public_html\news\edit_process.php[/b] on line [b]10[/b] [b]Warning:[/b] mysql_fetch_array(): supplied argument is not a valid MySQL result resource in [b]C:\Program Files\Server\public_html\news\edit_process.php[/b] on line [b]10[/b]
×
×
  • 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.