| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| NamePros Expert Join Date: Oct 2003 Location: ANForum
Posts: 5,218
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | sql database just a noob question how do i insert data to a sql database? what parameters are required?
__________________ |www.vb-skins.com|- Quality Premade Vbulletin skins for Your VB forum makeover |www.Banjir.com|-Free image hosting?[B]For Sale!|AlphaScripts|Money Generating Scripts FREE VB Skins |
| |
| | #2 (permalink) |
| NamePros Expert Join Date: Nov 2003 Location: Scotland
Posts: 5,069
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | the easiest way to input data into a mysql database is too use phpmyadmin http://www.phpmyadmin.net/home_page/ (if you use cpanel it is already there for you in your cpanel just go to the mysql database area and at the botton there is a link) If you are installing a package they ussually give you a .SQL file which is filled with sql queries that should be uploaded to the database (if they dont give you an installer that is) Alternatively they may provide you with the idnividual queries that can be input in the text box in the sql page of phpmyadmin
__________________ Manage your portfolio using my new Domain Portfolio Management script. Securing Your Domain Name From Theft |
| |
| | THREAD STARTER #3 (permalink) |
| NamePros Expert Join Date: Oct 2003 Location: ANForum
Posts: 5,218
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | hEEEEEEEEEEEEEEEEEElp can you help out or anybody free to do so??
__________________ |www.vb-skins.com|- Quality Premade Vbulletin skins for Your VB forum makeover |www.Banjir.com|-Free image hosting?[B]For Sale!|AlphaScripts|Money Generating Scripts FREE VB Skins |
| |
| | #4 (permalink) |
| NamePros Regular Join Date: Sep 2003
Posts: 890
![]() ![]() | You should really do some reasearch. I will tell you how but you probably won't understand most of it. Here is a simple PHP query: ????: NamePros.com http://www.namepros.com/programming/54727-sql-database.html mysql_query("INSERT INTO table_name (column1, column2) VALUES($value1, $value2)"); That'll work most of the time. You may need to add slashes or sometimes it's better to do something like this: mysql_query("INSERT INTO table_name (column1, column2) VALUES(" . $value1 . ", " . $value2 . ")"); And even more. It's best to put `` around column1 and column2 but not required. The reason for this is if you put spaces in the column names which is HIGHLY frowned upon. Also if you name a column a MySQL function. I've done this before and it's given me hours of headaches. Now its the first thing I check for.
__________________ Online Time Tracking :) |
| |
| | #5 (permalink) |
| NamePros Member Join Date: Sep 2003
Posts: 171
![]() ![]() | have you tried phpMyAdmin? if you want to insert thru php then you would do something like mysql_query("insert into news set title='news title', author='news author' "); you would insert a news title and a news author to a table called news and in which exist two fields: title and author.
__________________ Photoshop Tutorials Directory |
| |