PDA

View Full Version : In need of PHP help



Dan Williamson
29-12-2005, 12:36 AM
Hey there guys.

I'll be quick and get too the problem.

Well i've been running over the scripts on my computer. And i've come across one that I really like. It's a tutorial system where you can add your own tutorials etc. I've styled it with CSS so it looks not too bad :)

Anyway heres the problem, i'm getting a parse error and i'm not sure if my connection script is right.

I've hidden my pass so nobody can see it. So here it is.



<?php

$dbhost='localhost';
$dbusername='dan_dan';
$dbuserpass='*****';
$dbname='tutsystem';


mysql_connect ($dbhost, $dbusername, $dbuserpass);

if (!mysql_select_db($dbname)) die(mysql_error());

$query1 = "INSERT INTO tutorials (date,image,title,description,link,category) VALUES (now(),'".$image."','".$title."','".$description."','".$link."','".$category."')";
mysql_query($query1)or die(mysql_error());
?>

+Rep for anyone that helps in a good way, and deffo rep too anyone who solves it.

- Dan

Luckyrare
29-12-2005, 09:28 AM
I may be wrong but,



$dbhost='localhost';
$dbusername='dan_dan';
$dbuserpass='*****';
$dbname='dan_tutsystem';


Maybe that will work...

Splinter
29-12-2005, 09:45 AM
Whats the error?

Dan Williamson
29-12-2005, 10:28 AM
Don't worry.

I've fixed it. It was a parse error, just was coded badly :)

Thread closed

- Dan

Want to hide these adverts? Register an account for free!