Jump to content


Photo

mysql-sql syntax


  • Please log in to reply
4 replies to this topic

#1 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 01 May 2006 - 06:42 PM

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
mysql_connect("localhost", "west", "darkwind");
mysql_select_db("test");
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.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#2 Zane

Zane
  • Administrators
  • Advanced Member
  • 4,134 posts

Posted 01 May 2006 - 06:51 PM

PHP source code cannot be grabbed unless the creator makes in available in a php-source MIME type
usually has the extension .phps

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

btn_donate_SM.gif Want to thank me? Contribute to my PayPal piggy-bank
 

172938.png

#3 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 01 May 2006 - 07:15 PM

thanks

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#4 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 02 May 2006 - 06:43 PM

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.

Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

#5 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 02 May 2006 - 06:44 PM

thanks

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users