PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I have a code on that is a form to upload videos to my site in a database and something im doing is not allowing it to load, so can you look at this for me please.
The table is located under _videos --> upload --> and the "field" "title" is "upload" and the other field is "code", which is the code that I am trying to upload. Here is a screenshot...
http://morpia.com/php_problem.JPG
Page I am trying to put this on can be found here: http://morpia.com/site.php?page=upload
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
<?php
$conn = mysql_connect('localhost', 'morpiaco_videos', '*****') or die ('Error connecting to mysql:' . mysql_error());
mysql_select_db('morpiaco_videos') or die(mysql_error());
$query = "SELECT title, code FROM upload WHERE code='$code'";
$result = mysql_query($query) or die(mysql_error());
// This is going to do nothing at all for you
//mysql_query("SELECT DATE_FORMAT(date, '%m/%d/%Y') as formatteddate");
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
echo $row['code'] . '<br />';
}
mysql_close($conn);
?>
Warning: mysql_connect(): Access denied for user: 'morpiaco_videos@localhost' (Using password: YES) in /home/morpiaco/public_html/upload.php on line 2
Error connecting to mysql:Access denied for user: 'morpiaco_videos@localhost' (Using password: YES)
and that date format was from my old site, i simply took the old code and tried putting it on my new site and changed a little of it, and apparently it didnt work
Never mind, i got it by myself, it had absolutely nothing to do with anything any of you said. I took off the code u suggested and took off the "WHERE 'code'=" thing and it worked fine...
If You are Hosted in some shared Server Go to your control panel to get the correct User Name. Or Create A New Use From Php My Admin. And Then Use That User name.