MySQL Connect Error

  • joebert
  • Weathered
  • Genius
  • User avatar
  • Joined: Feb 10, 2004
  • Posts: 11872
  • Loc: Clearwater, FL
  • Status: Offline

Post April 8th, 2008, 7:06 am

How about this ?

PHP Code: [ Download ] [ Select ]
$dbconx = mysql_connect('localhost','root','') or die('Error connecting to database');
mysql_select_db('cia_db',$dbconx) or die('Error selecting database');
$sql = sprintf('INSERT INTO `idea` (`agent`, `presntn`, `comment`, `detail`, `topic`, `outcome`)
                VALUES(\'%1$s\', \'%2$s\', \'%3$s\', \'%4$s\', \'%5$s\', \'%6$s\')',
                mysql_real_escape_string($user),
                mysql_real_escape_string($presntn),
                mysql_real_escape_string($comment),
                mysql_real_escape_string($detail),
                mysql_real_escape_string($topic),
                mysql_real_escape_string($outcome)
);
//echo $sql;
mysql_query($sql,$dbconx) or die(' Error executing query');
mysql_close();
  1. $dbconx = mysql_connect('localhost','root','') or die('Error connecting to database');
  2. mysql_select_db('cia_db',$dbconx) or die('Error selecting database');
  3. $sql = sprintf('INSERT INTO `idea` (`agent`, `presntn`, `comment`, `detail`, `topic`, `outcome`)
  4.                 VALUES(\'%1$s\', \'%2$s\', \'%3$s\', \'%4$s\', \'%5$s\', \'%6$s\')',
  5.                 mysql_real_escape_string($user),
  6.                 mysql_real_escape_string($presntn),
  7.                 mysql_real_escape_string($comment),
  8.                 mysql_real_escape_string($detail),
  9.                 mysql_real_escape_string($topic),
  10.                 mysql_real_escape_string($outcome)
  11. );
  12. //echo $sql;
  13. mysql_query($sql,$dbconx) or die(' Error executing query');
  14. mysql_close();
Why yes, yes I am.
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post April 8th, 2008, 7:06 am

  • yomi
  • Student
  • Student
  • User avatar
  • Joined: Apr 02, 2008
  • Posts: 92
  • Loc: Nigeria
  • Status: Offline

Post April 16th, 2008, 12:07 am

Hi guys, guess what? just a silly thing i overlooked! initially i was collecting my date as a string in this format (yyyy-mm-dd)i later changed it on the form to a drop down list which stored month as 'mmm' well i corrected this and it still dint work. also, for some funny reason, collecting the date automatically (in a hidden field)from the form page was not getting submitted into the database so i decided to collect and submit at the point of database insertion and it worked. so 'error executing query' aspect is resolved.

now why would my gethostbyaddr not work? i have disabled anonymous authentication and enabled windows authentication. i'm also still unable to shoot mails from my application. anybody knows whats gwan?

Post April 18th, 2008, 6:14 am

hi
what server u r using,
please tell again..

u r using IIS or apache..

also tell problem in remote computer or local machine
  • yomi
  • Student
  • Student
  • User avatar
  • Joined: Apr 02, 2008
  • Posts: 92
  • Loc: Nigeria
  • Status: Offline

Post April 18th, 2008, 7:13 am

well, i am using iis6.

the whole stuff is now resolved. the culprit was McAfee, blocking my mails as spam. Also got gethostbyname(REMOTE_USER) to give me wht i needed, though used a sting fxn to pick the exact xters i wanted.

i'm glad its done and thank y'all for being part of it. Cheers!

Post Information

  • Total Posts in this topic: 34 posts
  • Users browsing this forum: No registered users and 169 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© Unmelted Enterprises 1998-2009. Driven by phpBB © 2001-2009 phpBB Group.