non phpnuke script

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   non phpnuke script
Ryman
CZ Super Newbie
Ryman has been a member for over 20 year's 20 Year Member
usa.gif illinois.gif
Occupation: Student, Webmaster, That little annoying geek
Fav. Sports Team: STL Cardinals
Website:
Status: Offline
Joined: Jan 13, 2004
0.01 posts per day
Posts: 50
Points: 3,510
   
OK, i am creating a newsletter mailer, and right now i am trying to make the install file. well, when i try to connect, the script dies. I have the connection variables stored in a config file, is thats whats wrong? the script is below. i am following my webhosts settings to a T.

<?php
//install.php
//Part of Newsletter Mailer 1.0
//For support, visit [ Register or login to view links on this board. ]

include("config.php");
if(mysql_connect("$dbhost", "$dbuser", "$dbpass"));
   die("Failed to connect to MySQL.");
if(!mysql_create_db("newsletter_db", $link_id))
   die("Failed to create the database newsletter_db.");
if(!mysql_query("CREATE TABLE email_add"))
   die("Failed to create the table email_add.");
echo "Installation complete!  Please delete this install file.";
?>



Back to top Reply with quote
#2   re: non phpnuke script
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,475
   
Where is the actual connection? Above you have a if connection doesnt work but no connection.

$connect = mysql_connect('localhost','user','pass');
if(!mysql_connect("$dbhost", "$dbuser", "$dbpass"));
   die("Failed to connect to MySQL.");


Something like that.



_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#3   re: non phpnuke script
Ryman
CZ Super Newbie
Ryman has been a member for over 20 year's 20 Year Member
usa.gif illinois.gif
Occupation: Student, Webmaster, That little annoying geek
Fav. Sports Team: STL Cardinals
Website:
Status: Offline
Joined: Jan 13, 2004
0.01 posts per day
Posts: 50
Points: 3,510
   
ok, ill try that, since there was no initial connect command, it is probably dieing



Back to top Reply with quote
#4   re: non phpnuke script
Ryman
CZ Super Newbie
Ryman has been a member for over 20 year's 20 Year Member
usa.gif illinois.gif
Occupation: Student, Webmaster, That little annoying geek
Fav. Sports Team: STL Cardinals
Website:
Status: Offline
Joined: Jan 13, 2004
0.01 posts per day
Posts: 50
Points: 3,510
   
as i was changing the script, i found some missing semicolons too




I LOVE CZ!!!! If it wasnt for u guys, it probably would have taken forever to finish my install script. icon_biggrin.gif



Back to top Reply with quote
#5   re: non phpnuke script
Ryman
CZ Super Newbie
Ryman has been a member for over 20 year's 20 Year Member
usa.gif illinois.gif
Occupation: Student, Webmaster, That little annoying geek
Fav. Sports Team: STL Cardinals
Website:
Status: Offline
Joined: Jan 13, 2004
0.01 posts per day
Posts: 50
Points: 3,510
   
ok, it is now able to connect
new problem-
it now cannot create the table "newsletter_db"


<?php
//install.php
//Part of Newsletter Mailer 1.0
//For support, visit [ Register or login to view links on this board. ]

include("config.php");
$link_id = mysql_connect("$dbhost", "$dbuser", "$dbpass");
   if(!mysql_connect("$dbhost", "$dbuser", "$dbpass"))
      die("Failed to connect to MySQL.");
$new_db = mysql_create_db("newsletter_db", $link_id);
   if(!mysql_create_db("newsletter_db", $link_id))
      die("Failed to create the database newsletter_db.");
$new_table = mysql_query("CREATE TABLE email_add");   
   if(!mysql_query("CREATE TABLE email_add"))
      die("Failed to create the table email_add.");
echo "Installation complete!  Please delete this install file.";
?>


im going to switch error reporting to the sql_error() function and see what that gives me


Back to top Reply with quote
#6   re: non phpnuke script
Ryman
CZ Super Newbie
Ryman has been a member for over 20 year's 20 Year Member
usa.gif illinois.gif
Occupation: Student, Webmaster, That little annoying geek
Fav. Sports Team: STL Cardinals
Website:
Status: Offline
Joined: Jan 13, 2004
0.01 posts per day
Posts: 50
Points: 3,510
   
problem server-specific, thx for all ur help



Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
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 vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum