Jump to content

Archived

This topic is now archived and is closed to further replies.

Ninjakreborn

mysql-sql syntax

Recommended Posts

there are a few things I am trying to figure out the meaning of but haven't seen any information about what these specifically mean, or do
1.INT
2.NOT
3.NULL
4.AUTO INCREMENT

And when doing a mysql connect like
[code]
mysql_connect("localhost", "west", "darkwind");
mysql_select_db("test");
[/code]
The password I changed here, but basically what I am wondering is, say for instance someone playing around with a website, they can pull the website pages so they can see hte php source code, it's not that hard, they can get it to where they can read it, I have done it just to try and get some knowledge on how other people use code, so I can understand some of what is going on, well if someone does that, won't they automatically get ahold of your username, password, database name, and be able to connect to your database using that, without that much hassle, hopefully someone can explain this so I am not so paranoid.

Share this post


Link to post
Share on other sites
PHP source code cannot be grabbed unless the creator makes in available in a php-source MIME type
usually has the extension [b].phps[/b]

PHP means Hypertext PreProcessor...so think of it as an HTML generator
you make code to either logically make HTML code, or systematically make it.

If someone did you a program to steal a PHP file
like flashGet or getright
all they would attain is the preprocessed HTML



and as for your vocab questions
1.INT = a number type
2.NOT = self explanatory
3.NULL = nothing
4.AUTO INCREMENT = increment by one for every row

Share this post


Link to post
Share on other sites
You should consider including a PHP script that connects to your DB instead of hard-coding this at the top of every script.

As far as your keywords, you should be aware that NULL has many implications for query performance, particularly as it relates to indexes. I remember a few posts where this was discussed at length; use this sparingly. WRT "INT", be aware of the size limitation, and consider the UNSIGNED attribute. For auto-increment, this only applies to newly inserted records where you do not explicitly request a particular value -- and without a primary key index on this column, it's quite meaningless.

Share this post


Link to post
Share on other sites

×

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.