Page 2 of 2 First 12
  • Jump to page:
    #16
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    13
    Rep Power
    0
    by changing the code as per your instructions another error is coming



    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
  2. #17
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2012
    Posts
    119
    Rep Power
    32
    No - it is how it should be formatted for it to work (I have been doing this a long time)
  4. #18
  5. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2012
    Posts
    119
    Rep Power
    32
    So is the id actually being passed to the page? Have you used the isset function to check? Have you echo'd out your query and run it in PHPMyAdmin to make sure it is correct and works?

    You have several queries so how are we supposed to know which one isn't working?
  6. #19
  7. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,959
    Rep Power
    1014
    @ simplypixie:

    Why do insist on the quotes? SQL -- like pretty much any other language -- uses plain digit sequenes as integer literals. So
    Code:
    SELECT 1 + 1;
    is valid SQL. No need to use any quotes.

    And as long as he doesn't manage to escape the values, the quotes also don't increase security in any way.



    @ chinkoo:

    So what's with the query code I gave you? Are you not interested? Will you "add security later"? (famous last words)

    As long as the general query logic is broken, it makes little sense to dive into an endless debugging session, because you'll have to rewrite the code, anyway.

    I'd also ask you to use a bit of common sense and do some thinking on your own. When you see the URL
    Code:
    movie_details.php?movie_id=$movie_id
    in your browser and get a strange error message about "$movie_id", did it never occur to you that maybe your link isn't quite right?

    You forgot to actually echo the variable:
    PHP Code:
    <a href="movie_details.php?movie_id=<?php echo urlencode($movie_id?>">
    OK, when you still have SQL error, then output your queries and paste them here in the forum (like simplypixie said). If you don't see the error, then probably we will.

    I mean, I don't know about you, but I think it might be time to actually fix the problem and stop that game of us making a guess and you telling us that it still doesn't work.
  8. #20
  9. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2012
    Posts
    119
    Rep Power
    32
    What I am saying is that the quotes won't cause an error if the data is numeric. As it is, it appears to me that they want to send through the table column name so it will not be numeric anyway!!
  10. #21
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    13
    Rep Power
    0

    removed the codes


    the error which is being displayed now is




    Unknown column '$movie_id' in 'where clause'
  12. #22
  13. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2012
    Posts
    119
    Rep Power
    32
    It is no good just posting your errors, we need to see your current code as well.

    What this is telling me though is that for some reason you have
    PHP Code:
    WHERE $movie_id
    in your query now which will produce an error as you don't have a column in your table called $movie_id.
  14. #23
  15. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,959
    Rep Power
    1014
    I give up. Have fun, simplypixie.
  16. #24
  17. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2012
    Posts
    119
    Rep Power
    32
    Originally Posted by Jacques1
    I give up. Have fun, simplypixie.
    To be honest, so do I but thought I would try once more

    Comments on this post

    • Jacques1 agrees : Thumbs up for your patience. ;-)
  18. #25
  19. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    13
    Rep Power
    0

    thanx all


    The problem is solved thanzx alll for replying and contributing your precious time
  20. #26
  21. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,959
    Rep Power
    1014
    If you're still using your old query code, it will only "work" until somebody with bad intentions and basic SQL knowledge finds your site.

    Comments on this post

    • simplypixie agrees
Page 2 of 2 First 12
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo