SitePoint Sponsor

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 25 of 32

Thread: Please help me.

  1. #1
    SitePoint Guru
    Join Date
    Nov 2002
    Location
    Dubai
    Posts
    715
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Please help me.

    Hello,

    I am using Kevin Yank's 'Build your own Database Driven Website using PHP and MySQL'. I have encountered a problem in chapter 7, Content Formatting and Submission. I had written the code for the page, joke.php. But when I open my page, other than a link back to my page, index.php, the rest of the page is blank. Since, I am not receiving any error message, it cannot be a coding error, I presume.
    The following is the body of my code for joke.php

    PHP Code:
    <body>
    <?php
    $dbcnx 
    mysql_connect("localhost","root");
    mysql_select_db("jokes");
    // Get the joke text from the database
    $id $_GET['id'];
    $joke mysql_query("SELECT JokeText FROM jokes " .
                     
    "WHERE ID='$id'");
    $joke mysql_fetch_array($joke); 
    $joketext $joke["JokeText"];
    //Filter out HTML code
    $joketext htmlspecialchars($joketext);
    // If no page specified, default to the 
    // first page ($page = 0)
    if (!isset($_GET['page'])) $page 0;
    else 
    $page $_GET['page'];
    // Split the text into an array of pages
    $textarray=split("\[PAGEBREAK]",$joketext);
    //Select the page we want
    $joketext=$textarray[$page];
    // Bold and italics
    $joketext eregi_replace("\[b]","<b>",$joketext);
    $joketext eregi_replace("\[eb]","</b>",$joketext);
    $joketext eregi_replace("\[i]","<i>",$joketext);
    $joketext eregi_replace("\[ei]","</i>",$joketext); 
    // Paragraphs and line breaks
    $joketext ereg_replace("\r","",$joketext);
    $joketext ereg_replace("\n\n","</p><p>",$joketext);
    $joketext ereg_replace("\n","<br \>",$joketext);
    // Hyperlinks
    $joketext ereg_replace(
    "\[L]([-_./a-zA-Z0-9!&%#?,'=:~]+)\[EL]",
    "<a href=\"[url="file:///1/"]\\1\">\\1</a[/url]>", $joketext);
    $joketext ereg_replace(
    "\[L=([-_./a-zA-Z0-9!&%#?,'=:~]+)]".
    "([-_./a-zA-Z0-9 !&%#?,'=:~]+)\[EL]",
    "<a href=\"[url="file:///1/"]\\1\">\\2</a[/url]>", $joketext);
    $PHP_SELF $_SERVER['PHP_SELF'];
    if (
    $page !=0) {
    $prevpage $page 1;
    echo(
    "<p><a href=\"$PHP_SELF?id=$id&page=$prevpage\">".
        
    "Previous Page</a></p>");
    }
    echo( 
    "<p>$joketext</p>" );
    if (
    $page count($textarray) - 1) {
    $nextpage $page 1;
    echo(
    "<p><a href=\"$PHP_SELF?id=$id&page=$nextpage\">".
    "Next Page</a></p>");
    }
    ?>
    <p><a href="index.php">Back to the front page</a></p>
    </body>
    [/PHP]

    I do not know where I am going wrong. Please help me. I had posted this question in an earlier thread but I think my question was not clear enough.

  2. #2
    SitePoint Wizard stereofrog's Avatar
    Join Date
    Apr 2004
    Location
    germany
    Posts
    4,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    > Since, I am not receiving any error message, it cannot be a coding error, I presume.

    Your presumption is correct for the languages like Java or C, but not for PHP. In php your should explicitly turn on error messages during debug. At the top of your code write

    PHP Code:
    ini_set('display_errors',1);
    error_reporting(E_ALL); 
    and replace every call to mysql_query to

    PHP Code:
    $result=mysql_query(...) or die(mysql_error()); 

  3. #3
    SitePoint Guru
    Join Date
    Nov 2002
    Location
    Dubai
    Posts
    715
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks. I had forgotten that. I will do so and then see what error message I get.

  4. #4
    SitePoint Guru
    Join Date
    Nov 2002
    Location
    Dubai
    Posts
    715
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am getting a parse error as given below on the line indicated.

    PHP Code:
     
    <body>
    <?php
    ini_set
    ('display_errors',1); 
    error_reporting(E_ALL);   
    $dbcnx mysql_connect("localhost","root");
    if(!
    dbcnx){
    echo(
    "<p>Unable to connect to the " .
    "database server at this time.</p>");
    }
    mysql_select_db("jokes");
    // Get the joke text from the database
    $id $_GET['id'];
    $joke mysql_query("SELECT JokeText FROM jokes " .
                         
    "WHERE ID='$id'");
    if(!
    $joke) {
    die(
    '<p>Error performing query: ' .
    mysql_error() .
    '.</p>;
    }
    $joke = mysql_fetch_array($joke);
    $joketext = $joke['
    JokeText']; //  I am getting a Parse error: parse error, unexpected T_STRING 
                                       on this line
    // Filter out HTML code
    $joketext = htmlspecialchars($joketext);
    // If no page specified, default to the 
    // first page ($page = 0)
    if (!isset($_GET['
    page'])) $page = 0;
    else $page = $_GET['
    page'];
    // Split the text into an array of pages
    $textarray=spliti('
    \[PAGEBREAK]',$joketext);
    // Select the page we want
    $joketext=$textarray[$page];
    // Bold and italics
    $joketext = str_replace(array('
    [b]','[B]'),'<strong>',$joketext);
    $joketext = str_replace(array('
    [eb]','[EB]'),'</strong>',$joketext);
    $joketext = str_replace(array('
    [i]','[I]'),'<em>',$joketext);
    $joketext = str_replace(array('
    [ei]','[EI]'),'</em>',$joketext);
    // Paragraphs and line breaks
    $joketext = ereg_replace("\r",'',$joketext);
    $joketext = ereg_replace("\n\n",'
    </p><p>',$joketext);
    $joketext = ereg_replace("\n",'
    <br />',$joketext);
    // Hyperlinks
    $joketext = ereg_replace(
      '
    \[L]([-_./a-zA-Z0-9!&%#?+,\'=:~]+)\[EL]',
      
    '<a href="[url="file://\1&quot;>\1</a>'"]\\1">\\1</a>'[/url], $joketext);
    $joketext = ereg_replace(
      '
    \[L=([-_./a-zA-Z0-9!&%#?+,\'=:~]+)]'.
      
    '([-_./a-zA-Z0-9 !&%#?+$,\'"=:;~]+)\[EL]',
      
    '<a href="[url="file://\1&quot;>\2</a>'"]\\1">\\2</a>'[/url], $joketext);
    $PHP_SELF = $_SERVER['
    PHP_SELF'];
    if ($page !=0) {
      $prevpage = $page - 1;
      echo("<p><a href=\"$PHP_SELF?id=$id&page=$prevpage\">".
           '
    Previous Page</a></p>');
    }
    echo( "<p>$joketext</p>" );
    if ($page < count($textarray) - 1) {
      $nextpage = $page + 1;
      echo("<p><a href=\"$PHP_SELF?id=$id&page=$nextpage\">".
           '
    Next Page</a></p>');
    }
    ?>
    <p><a href="index.php">Back to the front page</a></p>
    </body>

  5. #5
    SitePoint Wizard
    Join Date
    Oct 2001
    Posts
    2,686
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Change (around line #15)
    PHP Code:
    if(!$joke) {
        die(
    '<p>Error performing query: ' mysql_error() . '</p>');

    -Helge

  6. #6
    SitePoint Guru
    Join Date
    Nov 2002
    Location
    Dubai
    Posts
    715
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I did make the change as mentioned by you. But I am still getting the same result.

  7. #7
    SitePoint Addict streetlife's Avatar
    Join Date
    Mar 2004
    Location
    D-Town
    Posts
    369
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:

    if(!$joke) {
    die(
    '<p>Error performing query: ' .
    mysql_error() .
    '.</p>;
    }
    $joke = mysql_fetch_array($joke);
    $joketext = $joke['
    JokeText']; //  I am getting a Parse error: parse error, unexpected T_STRING on this line 
    Change to
    PHP Code:

    if(!$joke) {
    die(
    '<p>Error performing query: ' .
    mysql_error() .
    '.</p>';
    }
    $joke mysql_fetch_array($joke);
    $joketext $joke['JokeText']; //  I am getting a Parse error: parse error, unexpected T_STRING on this line 

  8. #8
    SitePoint Guru
    Join Date
    Nov 2002
    Location
    Dubai
    Posts
    715
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy Really getting frustrated

    Thanks. That was a typing error which I did rectify but that did not help me. I am getting really frustrated now.

    I am giving my full code again and have mentioned the line on which I am getting the following error. I do not know what it means. I am really stuck with this code and pray that I get help.

    PHP Code:
    <body>
    <?php
    ini_set
    ('display_errors',1); 
    error_reporting(E_ALL);  
    $dbcnx mysql_connect('localhost''root');
    if(!
    $dbcnx){
    echo(
    "<p>Unable to connect to the " .
    "database server at this time.</p>");
    }
    mysql_select_db('jokes');
    // Get the joke text from the database
    $id $_GET['id'];
    $joke mysql_query("SELECT JokeText FROM jokes " .
                         
    "WHERE ID='$id'");
    if(!
    $joke) { 
        die(
    '<p>Error performing query: ' mysql_error() . '</p>'); 

    $joke mysql_fetch_array($joke);
    $joketext $joke['JokeText'];
    // Filter out HTML code
    $joketext htmlspecialchars($joketext);
    // If no page specified, default to the 
    // first page ($page = 0)
    if (!isset($_GET['page'])) $page 0;
    else 
    $page $_GET['page'];
    // Split the text into an array of pages
    $textarray=spliti('\[PAGEBREAK]',$joketext);
    // Select the page we want
    $joketext=$textarray[$page];
    // Bold and italics
    $joketext str_replace(array('[b]','[B]'),'<strong>',$joketext);
    $joketext str_replace(array('[eb]','[EB]'),'</strong>',$joketext);
    $joketext str_replace(array('[i]','[I]'),'<em>',$joketext);
    $joketext str_replace(array('[ei]','[EI]'),'</em>',$joketext);
    // Paragraphs and line breaks
    $joketext ereg_replace("\r",'',$joketext);
    $joketext ereg_replace("\n\n",'</p><p>',$joketext);
    $joketext ereg_replace("\n",'<br />',$joketext);
    // Hyperlinks
    $joketext ereg_replace(
      
    '\[L]([-_./a-zA-Z0-9!&%#?+,\'=:~]+)\[EL]',
      
    '<a href="[url="file://\1&quot;>\1</a>'"]\\1">\\1</a>'[/url], $joketext);
    $joketext = ereg_replace(
      '
    \[L=([-_./a-zA-Z0-9!&%#?+,\'=:~]+)]'.
      
    '([-_./a-zA-Z0-9 !&%#?+$,\'"=:;~]+)\[EL]',
      
    '<a href="[url="file://\1&quot;>\2</a>'"]\\1">\\2</a>'[/url], $joketext);
    $PHP_SELF = $_SERVER['
    PHP_SELF'];
    if ($page != 0) {
      $prevpage = $page - 1;
      echo("<p><a href=\"$PHP_SELF?id=$id&page=$prevpage\">".
           '
    Previous Page</a></p>');
    }
    echo( "<p>$joketext</p>" );
    if ($page < count($textarray) - 1) {
      $nextpage = $page + 1;
      echo("<p><a href=\"$PHP_SELF?id=$id&page=$nextpage\">".
           '
    Next Page</a></p>');
    }
    ?>
    <p><a href="index.php">Back to the front page</a></p>
    </body>
    I am really stuck with this code and pray that I get help.

  9. #9
    SitePoint Guru
    Join Date
    Nov 2002
    Location
    Dubai
    Posts
    715
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am still waiting for someone to help me. Please.

  10. #10
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,604
    Mentioned
    19 Post(s)
    Tagged
    2 Thread(s)
    jppp,

    You're misusing your variables:

    Code:
    if(!$joke) {
    die('<p>Error performing query: ' .
    mysql_error() .
    '.</p>;
    }
    $joke = mysql_fetch_array($joke); // <-- ERROR!
     
    Code:
    $joketext = $joke['JokeText'];
    


    Note that you are reassigning the $joke multi-dimensional array to the $joke singular array (row). Change this to:

    Code:
    $joker = mysql_fetch_array($joke);
    $joketext = $joker['JokeText'];
    and you should be okay.

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  11. #11
    SitePoint Guru
    Join Date
    Nov 2002
    Location
    Dubai
    Posts
    715
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your help, DK.

    But I continue to get the same error as before.

  12. #12
    SitePoint Evangelist
    Join Date
    Feb 2004
    Location
    Sofia, Bulgaria
    Posts
    421
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    try update your code with this...
    PHP Code:
    ini_set('display_errors',1); 
    error_reporting(E_ALL);  
    $dbcnx mysql_connect('localhost''root') or die('<p>Unable to connect to the database server at this time.</p>');
    mysql_select_db('jokes');
    // Get the joke text from the database
    $id $_GET['id'];
    $joke mysql_query('SELECT JokeText FROM jokes WHERE ID=' $id) or die('<p>Error performing query: ' mysql_error() . '</p>'); 
    $joke_row mysql_fetch_assoc($joke);
    $joketext $joke_row['JokeText'];
    // Filter out HTML code
    $joketext htmlspecialchars($joketext);
    // If no page specified, default to the 
    // first page ($page = 0)
    $page = ((isset($_GET['page'])) ? ((int) $_GET['page']) : 0);
    // Split the text into an array of pages 

  13. #13
    SitePoint Guru
    Join Date
    Nov 2002
    Location
    Dubai
    Posts
    715
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am still getting the same errors. I think I am making some basic mistake. I wonder why the code is going wrong when I have copied it from the code archive provided by SitePoint and all the codes which I had earlier copied from the code archive after making the necessary changes to suit my database had worked without any problems. Will I finally have to turn to Kevin Yank himself for help?

  14. #14
    Now with customized title Jump's Avatar
    Join Date
    Sep 2002
    Location
    The Restaurant at The End of The Universe
    Posts
    1,423
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think the key here is T_STRING

    This
    PHP Code:
    $joke mysql_query("SELECT JokeText FROM jokes " .
                         
    "WHERE ID='$id'"); 
    Should be

    PHP Code:
    $joke mysql_query("SELECT JokeText FROM jokes
                         WHERE ID='
    $id'"); 
    Which would have no unexpected T_STRING

  15. #15
    SitePoint Evangelist
    Join Date
    Feb 2004
    Location
    Sofia, Bulgaria
    Posts
    421
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by jppp
    I am still getting the same errors. I think I am making some basic mistake. I wonder why the code is going wrong when I have copied it from the code archive provided by SitePoint and all the codes which I had earlier copied from the code archive after making the necessary changes to suit my database had worked without any problems. Will I finally have to turn to Kevin Yank himself for help?
    well post code you are running now, error message and comment on which line in code you receive the error..

  16. #16
    SitePoint Guru
    Join Date
    Nov 2002
    Location
    Dubai
    Posts
    715
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Need your help

    The following is my full code.
    PHP Code:
    <!-- joke.php -->
    <html>
    <head>
    <title> Joke </title>
    </head>
    <body>
    <?php
    ini_set
    ('display_errors',1); 
    error_reporting(E_ALL);   
    $dbcnx mysql_connect('localhost''root') or die('<p>Unable to connect to the database server at this time.</p>'); 
    mysql_select_db('jokes'); 
    // Get the joke text from the database 
    $id $_GET['id']; // This is line 14
    $joke mysql_query('SELECT JokeText FROM jokes WHERE ID=' $id) or die('<p>Error performing query: ' mysql_error() . '</p>'); 
    $joke_row mysql_fetch_assoc($joke); 
    $joketext $joke_row['JokeText']; 

    // Filter out HTML code 
    $joketext htmlspecialchars($joketext); 
    // If no page specified, default to the 
    // first page ($page = 0) 
    $page = ((isset($_GET['page'])) ? ((int) $_GET['page']) : 0); 

    // Split the text into an array of pages
    $textarray=spliti('\[PAGEBREAK]',$joketext);

    // Select the page we want
    $joketext=$textarray[$page];

    // Bold and italics
    $joketext str_replace(array('[b]','[B]'),'<strong>',$joketext);
    $joketext str_replace(array('[eb]','[EB]'),'</strong>',$joketext);
    $joketext str_replace(array('[i]','[I]'),'<em>',$joketext);
    $joketext str_replace(array('[ei]','[EI]'),'</em>',$joketext);

    // Paragraphs and line breaks
    $joketext ereg_replace("\r",'',$joketext);
    $joketext ereg_replace("\n\n",'</p><p>',$joketext);
    $joketext ereg_replace("\n",'<br />',$joketext);

    // Hyperlinks
    $joketext ereg_replace(
      
    '\[L]([-_./a-zA-Z0-9!&%#?+,\'=:~]+)\[EL]',
      
    '<a href="[url="file://\1&quot;>\1</a>'"]\\1">\\1</a>'[/url], $joketext);
    $joketext = ereg_replace(
      '
    \[L=([-_./a-zA-Z0-9!&%#?+,\'=:~]+)]'.
      
    '([-_./a-zA-Z0-9 !&%#?+$,\'"=:;~]+)\[EL]',
      
    '<a href="[url="file://\1&quot;>\2</a>'"]\\1">\\2</a>'[/url], $joketext);

    $PHP_SELF = $_SERVER['
    PHP_SELF'];

    if ($page != 0) {
      $prevpage = $page - 1;
      echo("<p><a href=\"$PHP_SELF?id=$id&page=$prevpage\">".
           '
    Previous Page</a></p>');
    }

    echo( "<p>$joketext</p>" );

    if ($page < count($textarray) - 1) {
      $nextpage = $page + 1;
      echo("<p><a href=\"$PHP_SELF?id=$id&page=$nextpage\">".
           '
    Next Page</a></p>');
    }

    ?>
    <p><a href="index.php">Back to the front page</a></p>
    </body>
    </html>
    I am getting the following error.
    Notice: Undefined index: id on line 14

    Error performing query: You have an error in your SQL syntax near '' at line 1

    Thanks.

  17. #17
    SitePoint Guru
    Join Date
    Nov 2002
    Location
    Dubai
    Posts
    715
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I tried the following as JUMP said.

    $joke = mysql_query("SELECT JokeText FROM jokes WHERE ID='$id'");
    When I do as above, I do not get the Error performing query. But I still get the Undefined index:id on the line mentioned.

  18. #18
    SitePoint Evangelist
    Join Date
    Feb 2004
    Location
    Sofia, Bulgaria
    Posts
    421
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    use this code.. i think that you not pass the id correctly in the URL.. check your link to see if there is any id.. i assume that you pass it via GET method, if not fix the code below for POST.. the error in query is because the $id is empty string, the code below should fix that..
    PHP Code:
    $id = ((!empty($_GET['id'])) ? ((int) $_GET['id']) : 0);
    $joke mysql_query('SELECT JokeText FROM jokes WHERE ID=' $id) or die('<p>Error performing query: ' mysql_error() . '</p>'); 
    $joke_row mysql_fetch_assoc($joke); 
    $joketext $joke_row['JokeText']; 

  19. #19
    Now with customized title Jump's Avatar
    Join Date
    Sep 2002
    Location
    The Restaurant at The End of The Universe
    Posts
    1,423
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ahh, register globals. Is this from Kevins original outdated book or the new updated book? By the way, you don't want quotes arround an integer in an SQL query so it should just be $id not '$id'.

  20. #20
    SitePoint Guru
    Join Date
    Nov 2002
    Location
    Dubai
    Posts
    715
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    dacool, I used the code given by you and now I am back to square one. No errors on my page, just a link back to my page, index.php and the rest of the page is blank (By the way, being a complete newbie, I must confess that I did not really undertand part of your code eg why do you write my_sql_assoc instead of my_sql_array? )

    jump, I have the first edition of Kevin Yank's book but since it does not use register globals, I have been using the code from the code archive provided by Site Point and all the other examples so far had been working very well for me and I had reached upto chapter 7 of the book without any problem. I do not know why I am suddenly faced with a problem.

  21. #21
    SitePoint Evangelist
    Join Date
    Feb 2004
    Location
    Sofia, Bulgaria
    Posts
    421
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    try this:
    PHP Code:
     $id = ((!empty($_GET['id'])) ? ((int) $_GET['id']) : 0);
      echo 
    "$id<br>"// this will echo your ID, you will have results from query if $id is NOT zero
                      // if it' zero then you set it wrong in the previous page
      
    $joke mysql_query('SELECT JokeText FROM jokes WHERE ID=' $id) or die('<p>Error performing query: ' mysql_error() . '</p>'); 
      
    $joke_row mysql_fetch_assoc($joke); 
      
    $joketext $joke_row['JokeText']; 
    Quote Originally Posted by jppp
    (By the way, being a complete newbie, I must confess that I did not really undertand part of your code eg why do you write my_sql_assoc instead of my_sql_array? )
    Quote Originally Posted by PHP Manual
    mysql_fetch_assoc() is equivalent to calling mysql_fetch_array() with MYSQL_ASSOC for the optional second parameter. It only returns an associative array. This is the way mysql_fetch_array() originally worked. If you need the numeric indices as well as the associative, use mysql_fetch_array().
    if you use only the associative array, i mean if you call items only by labels and not by numbers, it's better to use mysql_fetch_assoc() because it will return only one array and mysql_fetch_array() (without the second parameter) will return two indentical arrays, one associative and one with numeric indices..

  22. #22
    SitePoint Guru
    Join Date
    Nov 2002
    Location
    Dubai
    Posts
    715
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am getting the integer 0 before the link back to my index page. So as per what you say, my ID in the previous page must be wrong.

    Now I am a newbie (I do not know when I can stop calling myself one) who has reached this far by using Kevin Yank's book.
    I have a few doubts.
    What do you mean by saying that I must have set it wrong in the previous page? Now I have a database called jokes with the columns, ID, JokeText, JokeDate and AID (Author's ID).
    I am facing a problem with my ID to which I did not give much importance earlie but could that be causing a problem? As you know, when I keep entering the jokes, the ID column gets incremented automatically. While I was learning how to add and delete the jokes, I had added and deleted many jokes. Now the data in my ID and Jokedate column read like this. The entries in my ID column do not start from 1. Instead they are 63, 64, 70, 71, 72, 67, 68 and 69. The jokedates are 17-4, 19-4, 27-4, 27-4, 28-4, 19-4, 19-4, 19-4. Is this what is causing the problem? Or is it happening because my jokes fit into one page and there is no need for a previous page and a next page? Where does the page break take place? When I add and delete jokes, how can I make my ID column start from 1 all over again?

    Sorry for my long list of questions which may sound outright dumb to experts like you but are very real to me.

  23. #23
    SitePoint Evangelist
    Join Date
    Feb 2004
    Location
    Sofia, Bulgaria
    Posts
    421
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    post the code from previous page where you generate the link with ID.. the problem is not in the numbers of ID that are in your database and there is no need your ID column to start from 1.. post your code and i'll can tell you more..

  24. #24
    SitePoint Guru
    Join Date
    Nov 2002
    Location
    Dubai
    Posts
    715
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am a little confused. I am generating the ID from my database called jokes, isn't it? Then which is the previous page you are mentioning? Sorry if my question is too dumb.

  25. #25
    SitePoint Evangelist
    Join Date
    Feb 2004
    Location
    Sofia, Bulgaria
    Posts
    421
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you pass the ID to this script by GET method, so in the page from which you send the user to this page (the script you've posted) you must generate a link with ID.. i'm having in mind the page to which you return by clicking on the back link.. post the code of that page..


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •