1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Rep Power

    Wont import values into table?

    So I have been stuck on this for a long time now. Thought I could use a more experienced member's help. I am trying to import my news post into my table news. I have tried a lot of things. But just so you know i'm a beginner with MySQL and have copy/pasted this code from YouTube:

    pastebin (.) com/KxEUY6qk
  2. #2
  3. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Rep Power

    what's the concrete problem? What error messages do you get?

    I mean, you can't expect us to set up a full test system for your code and then start testing in the hopes we stumble upon the same error (which we do not even know).

    However, I think it might make more sense to rewrite the code than trying to fix it. It has several massive security holes, and it's generally quite ... weird.

    Check the link in my signature to avoid typical mistakes like inserting variables into query strings. You should also stop copying and pasting stuff. The code looks like you merged two completely different scripts from different people. For example, you use the old MySQL extension and the new MySQLi extension at the same time, which makes absolutely no sense.

    Write your own code. It won't be perfect at first, and you'll have to spend some time on it. But at least it will make sense, and you'll actually learn the language.

    You should generally be careful with copy and paste in the PHP world. The internet is full of terrible PHP code and bad tutorials from clueless people. If you blindly copy that stuff, chances are you'll tear gigantic security holes into your server.

    Comments on this post

    • Nanomech agrees : Great advice!
    The 6 worst sins of security ē How to (properly) access a MySQL database with PHP

    Why canít I use certain words like "drop" as part of my Security Question answers?
    There are certain words used by hackers to try to gain access to systems and manipulate data; therefore, the following words are restricted: "select," "delete," "update," "insert," "drop" and "null".

IMN logo majestic logo threadwatch logo seochat tools logo