how 2 maintain database 4 php & how 2 connect database inphp

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
User avatar
nehrav
Forum Commoner
Posts: 38
Joined: Sun Sep 20, 2009 6:55 am
Location: New Delhi
Contact:

how 2 maintain database 4 php & how 2 connect database inphp

Post by nehrav »

Please guys,

tell me how can I maintain database for php...
I want to import the data/records from excel sheet in my database....
I am using phpMyadmin with WAMP.

Secondly, how to connect with my database...
On searching in google, I find this code suggested by developers...
I jst want to know where to add this...

<?php
$con = mysql_connect("localhost","peter","abc123");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}

// some code
?>
Mike2009
Forum Newbie
Posts: 7
Joined: Fri Sep 25, 2009 3:17 am

Re: how 2 maintain database 4 php & how 2 connect database inphp

Post by Mike2009 »

Have you read this already: viewtopic.php?f=1&t=106696
User avatar
nehrav
Forum Commoner
Posts: 38
Joined: Sun Sep 20, 2009 6:55 am
Location: New Delhi
Contact:

Re: how 2 maintain database 4 php & how 2 connect database inphp

Post by nehrav »

Mike2009 wrote:Have you read this already: viewtopic.php?f=1&t=106696
Mike, I appreciate your reply but I don't want particular cell range and I don't want the value
to be get stored in any array :( .

I just want my data to be transferred from excel file to my database...
I want it to be work as tool........ :dubious:

1000 records in one shot...... :crazy:
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: how 2 maintain database 4 php & how 2 connect database inphp

Post by josh »

phpmyadmin has import functions.
satishbhawra42
Forum Newbie
Posts: 2
Joined: Thu Oct 01, 2009 2:50 pm

Re: how 2 maintain database 4 php & how 2 connect database inphp

Post by satishbhawra42 »

On searching in google, I find this code suggested by developers...
I jst want to know where to add this...
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: how 2 maintain database 4 php & how 2 connect database inphp

Post by josh »

Click on databases, click your database.... click the import tab, once youre on this screen the next steps are pretty self evident.
User avatar
nehrav
Forum Commoner
Posts: 38
Joined: Sun Sep 20, 2009 6:55 am
Location: New Delhi
Contact:

Re: how 2 maintain database 4 php & how 2 connect database inphp

Post by nehrav »

josh wrote:Click on databases, click your database.... click the import tab, once youre on this screen the next steps are pretty self evident.
JOSH, I try uploading excel file using import function, but its giving me

invalid field count on file ....... on line 1................ 8O 8O 8O

I stuck at every step........ :cry:
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: how 2 maintain database 4 php & how 2 connect database inphp

Post by josh »

use csv
User avatar
nehrav
Forum Commoner
Posts: 38
Joined: Sun Sep 20, 2009 6:55 am
Location: New Delhi
Contact:

Re: how 2 maintain database 4 php & how 2 connect database inphp

Post by nehrav »

josh wrote:use csv
I am using csv file only but..... :banghead:

Invalid field count in CSV input on line 1
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: how 2 maintain database 4 php & how 2 connect database inphp

Post by josh »

your field count must be invalid then
User avatar
nehrav
Forum Commoner
Posts: 38
Joined: Sun Sep 20, 2009 6:55 am
Location: New Delhi
Contact:

Re: how 2 maintain database 4 php & how 2 connect database inphp

Post by nehrav »

josh wrote:your field count must be invalid then
can you send me a sample file, I will make amendments in that.. :drunk:
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: how 2 maintain database 4 php & how 2 connect database inphp

Post by josh »

Meaning it differs from the field count of your table.
Post Reply