Jump to content


Notepad Php File


  • Please log in to reply
2 replies to this topic

#1 phpnewbie1212

  • Members
  • Pip
  • Newbie
  • 5 posts

Posted 31 December 2012 - 01:46 PM

I am newbie when it comes to PHP.You probably know this from the question i am about to ask. I have created a php file in Notepad text editor. I want the file to connect to my database in mysql. I am unsure what the best approach is to link the file to the database in mysql that i wish to activate ?

#2 Barand

  • Moderators
  • Sen . ( ile || sei )
  • 17,843 posts

Posted 31 December 2012 - 01:52 PM

this link mysqli_connect should help
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received


|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#3 Jessica

  • Staff Alumni
  • This is not my name.
  • 8,982 posts
  • LocationDallas, TX
  • Age:26

Posted 31 December 2012 - 05:53 PM

The editor you use to write PHP is irrelevant to connecting to the database, just so you know. You should also look into a full IDE, we have a thread in misc about different ones.
My goal in replying to posts is to help you become a better programmer, including learning how to debug your own code and research problems. For that reason, rather than posting the solution, I reply with tips and hints on how to find the solution yourself. See below for useful links when you get stuck.

How to Get Good Help: How to Ask Questions | Don't be a help vampire
Debugging Your Code: Debugging your SQL | What does a php function do? | What does a term mean? | Don't see any errors?
Things You Should Do: Normalize Your Data | use print_r() or var_dump()
Lulz: "Functions should not have side effects." - trq

Please take a look at my new PHP/Web Dev blog: The Web Mason - Thanks!!

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users