Jump to content

icorange

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

icorange's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. So then I would have to contact GoDaddy and have them enable these extensions since I have no control over the php.in file? yes? oh please, oh please ...
  2. Hi ... thanks ... well I do understand that "mysql_connect_errno()" is in my code .... guess I'm just a little TOO new at this ... I used a "subscription.php" file right from Julie Meloni's third edition PHP, MySQL and Apache ... used it exactly ... hosting with GoDaddy - using Mysql 5.0 ... when I went to the site, entered an email ... the Fatal error came up in the browser ... I was then told to change all my "mysqli" to "mysql" ... same errors ... sorry for being so ignorant ... I just can't figure out what I am doing wrong :'(
  3. Hi! thanks .... copied right from the browser ... Fatal error: Call to undefined function: mysql_connect_errno() in ...
  4. Hi everyone ... thank you in advance for looking at this ... I have a site ... uploading to GoDaddy hosting (MySQL version 5.0) ... I've tried so many things with my coding, changed it from mysqli to mysql ... and everything else, I'm a bit confused now ... when I upload all my files for a VERY simple subscription service, I keep getting this error: Fatal error: Call to undefined function: mysql_connect_errno() I have read a lot about this error - and have made so many changes, I think my coding is a bit scrambled now ... I would really appreciate the help!!! Thanks again ... <?php function doDB() { global $mysql; $mysql = mysql_connect('hostsite', 'user', 'password', 'dbname'); if (mysql_connect_errno()) { printf("Connect failed: %s\n", mysql_connect_error()); exit(); } } function emailChecker($email) { global $mysql, $check_res; $check_sql = "SELECT id FROM SUBSCRIPTION WHERE email = '".$email."'"; $check_res = mysql_query($mysql, $check_sql) or die(mysql_error($mysql)); } if (!$_POST) { $display_block = " <form method=\"POST\" action=\"".$_SERVER["PHP_SELF"]."\"> <p><strong>Your E-Mail Address:</strong><br/> <input type=\"text\" name=\"email\" size=\"40\" maxlength=\"150\"> <p><strong>Action:</strong><br/> <input type=\"radio\" name=\"action\" value=\"sub\" checked> subscribe <input type=\"radio\" name=\"action\" value=\"unsub\"> unsubscribe <p><input type=\"submit\" name=\"submit\" value=\"Submit Form\"></p> </form>"; } else if (($_POST) && ($_POST["action"] == "sub")) { if ($_POST["email"] == "") { header("Location: form.php"); exit; } else { doDB(); emailChecker($_POST["email"]); if (mysql_num_rows($check_res) < 1) { mysql_free_result($check_res); $add_sql = "INSERT INTO subscription (email) VALUES('".$_POST["email"]."')"; $add_res = mysql_query($mysql, $add_sql) or die(mysql_error($mysql)); $display_block = "<p>Thanks for signing up!</p>"; mysql_close($mysql); } else { $display_block = "<p>You're already subscribed!</p>"; } } } else if (($_POST) && ($_POST["action"] == "unsub")) { if ($_POST["email"] == "") { header("Location: form.php"); exit; } else { doDB(); emailChecker($_POST["email"]); if (mysql_num_rows($check_res) < 1) { mysql_free_result($check_res); $display_block = "<p>Couldn't find your address!</p> <p>No action was taken.</p>"; } else { while ($row = mysql_fetch_array($check_res)) { $id = $row["id"]; } $del_sql = "DELETE FROM subscription WHERE id = '".$id."'"; $del_res = mysql_query($mysql, $del_sql) or die(mysql_error($mysql)); $display_block = "<p>You're unsubscribed!</p>"; } mysql_close($mysql); } } ?>
×
×
  • 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.