I have a csv file and I am not sure how to set dates on it... For example, if somebody submits a form and its information shows up in the csv but has a date that shows when it was submitted... Can someone help me with this?

Is there a way to do this purely out of php because for some odd reason I can't connect to mysql with DreamWeaver?

But thank you for your quick response :)

Member Avatar for diafol

Work through your problem with DW - or simply stop using it - there are plenty of great free-to-use editors/IDEs out there.
Using php without a DB but still needing storage is v.difficult. You have to rely on CSVs, textfiles, XMLs etc. Highly inconvenient.

Have you searched the php manual on date formats? Or strtotime, etc? Start here: http://uk3.php.net/manual/en/function.date.php and read the pages in the left nav list.

I should've mentioned I also own coda 2, that also has the same problem... But i am still searching for ways of connecting to a DB... and I have read the article :D

I forgot to mention that when I called GoDaddy on why I couldn't connect to MySQL, they said it was my problem...

Member Avatar for diafol

Do you have a cPanel setup? If so, there should be a way to connect to your DB remotely as you can provide your own IP addresses.

I'm sorry if I misunderstood this but do you mean a cPanel in GoDaddy or in DW?

Member Avatar for diafol

cPanel is the owner's admin panel to change settings and to set up databases etc. I'm not familiar with godaddy so I don't know what they offer. If they don't offer a cPanel for your account, they should at least provide connection (host) details that allow you to remote access the DB.

Your hosted site should connect to the DB using 'localhost', BUT this cannot be the case if you're trying to connect to the same DB from a copy of the site on your local testing server. Perhaps I've got the wrong end of the stick here.

I'm assuming that your DB and site is hosted by GoDaddy and that you've got a local copy of the site which you're developing in Dreamweaver. Tell me if I'm wrong.

Well, I have to connect dreamweaver to godaddy mysql... i think I just word things really badly, but I set up a new DB on GoDaddy, and what should I do from there?

Member Avatar for diafol

I don't know. Do you have remote access to the DB? Either way you need the db host address for the connection.

I believe I have remote access... honestly I'm not sure... When I attempted to connect I kept getting an unidentified error...

Member Avatar for diafol

believe I have remote access... honestly I'm not sure

Well, until you find out, there's little I can suggest.

Can you tell me what goes on if I do have those capabilities... I can try to follow that procedure? (maybe I'll find out there?)

Member Avatar for diafol

You should have a host address for the DB, e.g. 'diafol-mysql-12' - but it could be called anything.

I'm including a mysql_* example here, but you really should think of using mysqli_* or PDO:

$link = mysql_connect('diafol-mysql-12', 'diafol', '5c00by d00'); //change these parameters to yours (hostname, username, password)
if (!$link) {
    die('Not connected : ' . mysql_error());
}

// make foo the current db
$db_selected = mysql_select_db('mydatabase', $link); //change the mydatabase to your name
if (!$db_selected) {
    die ('Can\'t use foo : ' . mysql_error());
}

I just checked the godaddy site and it does not include cPanel for shared hosting - which I assume is what you have. However, it does if you use Virtual or Dedicated Servers. So, I'll stop banging on about cPanel! :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.