Jump to content

Having some connection issues.


jeaker

Recommended Posts

I was wondering if there were any PHP masters that could help me out. I cannot spot any errors in the code but i am fairly new to PHP. It is giving me an access denied error. Any help would be greatly appreciated.

[code]<?php
if ((!$_POST[id]) || (!$_POST[format]) || (!$_POST[title])) {
header( "Location: show_addrecord.html");
exit;
}

$db_name = "testdb";
$table_name = "my_music";
I know this part is correct-[$connection = @mysql_connect('db.blah.blahwebsites.com', 'jondoe', '********')
or die(mysql_error());]
$db = mysql_select_db($db_name, $connection) or die(mysql_error());
$sql = "INSERT INTO $table_name
(id, format, title, artist_fn, artist_ln, rec_label,
my_notes, date_acq) VALUES
('$_POST[id]', '$_POST[format]', '$_POST[title]',
'$_POST[artist_fn]', '$_POST[artist_ln]', '$_POST[rec_label]',
'$_POST[my_notes]', '$_POST[date_acq]')";
$result = @mysql_query($sql, $connection) or die(mysql_error());

?>[/code]
Link to comment
https://forums.phpfreaks.com/topic/26349-having-some-connection-issues/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.