Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7807913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T03:00:11+00:00 2026-06-02T03:00:11+00:00

This is a code to register the head of a group and then his

  • 0

This is a code to register the head of a group and then his partner(s).

<?
session_start();
require_once('db.php');
$db = new DB();
$db->newHead($_POST['fname'], $_POST['lname'], $_POST['school'], $_POST['day'], $_POST['month'], $_POST['year'], $_POST['email']);
$hId = $db->getId($_POST['email'], 1);
if ($_POST['pnum'] === 1)
{
    $db->newPartner($hId, $_POST['fname1'], $_POST['lname1'], $_POST['day1'], $_POST['month1'], $POST['year1'], $_POST['email1']);
    $pId = getId($_POST['email1'], 0);
    $db->setHeadId($hId, $pId, 1);
}
if ($_POST['pnum'] === 2)
{
    $db->newPartner($hId, $_POST['fname1'], $_POST['lname1'], $_POST['day1'], $_POST['month1'], $POST['year1'], $_POST['email1']);
    $p1Id = getId($_POST['email1'], 0);
    $db->setHeadId($hId, $p1Id, 1);

    $db->newPartner($hId, $_POST['fname2'], $_POST['lname2'], $_POST['day2'], $_POST['month2'], $POST['year2'], $_POST['email2']);
    $p2Id = getId($_POST['email2'], 0);
    $db->setHeadId($hId, $p2Id, 2);
}
header("Location:Register.php");
?>

and this is part of db.php:

    public function getId($email, $type)
{
    if ($type)
        $query = "SELECT * FROM t_head where h_email = '$email';";
    else
        $query = "SELECT * FROM t_partner where p_email = '$email';";
    return $this->query($query);
}

public function newPartner($hId, $fname, $lname, $day, $month, $year, $email)
{
    $query = "INSERT INTO t_partner (p_headid, p_fname, p_lname, p_day, p_month, p_year, p_email)
    VALUES ('$hId', '$fname', '$lname', '$day', '$month', '$year', '$email');";
    return $this->query($query);
}

public function newHead($fname, $lname, $hschool, $day, $month, $year, $email)
{
    $query = "INSERT INTO t_head (h_fname, h_lname, h_school, h_day, h_month, h_year, h_email)
    VALUES('$fname', '$lname', '$hschool', '$day', '$month', '$year', '$email');";
    return $this->query($query);
}

    public function setHeadId($hId, $pId, $num)
    {
        if ($num === 1)
            $query = "UPDATE t_head SET h_p1 = '$pId' WHERE h_id = '$hId';";
        else
            $query = "UPDATE t_head SET h_p2 = '$pId' WHERE h_id = '$hId';";
        $this->execute($query);
    }

What’s the problem?
DB is class that is worked with PDO. (I don’t know what’s this! but I always copy it then I write the functions at then bottom of it and it always worked correctly.) But know What does this error mean?

  • Excuse me If I pasted all of the code! I don’t know SQLSTATE[HY000]: General error is related to which part, so that I couldn’t paste any specific part/func for you.

  • My site copied to another server and the DNS was changed near 3 hours ago for a purpose. If this detail can help you …

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T03:00:13+00:00Added an answer on June 2, 2026 at 3:00 am

    It happened to me something similar a few weeks ago. I fixed it changing the php.ini

    I changed

    ;extension=php_pdo_mysql_mysqlnd.dll
    extension=php_pdo_mysql_libmysql.dll
    

    to

    extension=php_pdo_mysql_mysqlnd.dll
    ;extension=php_pdo_mysql_libmysql.dll
    

    basically you change the mysql driver php uses. I used xampplite 1.7

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code to register dlls into my gac Assembly asm = Assembly.LoadFrom(argument);
I've this code in flex where I register a mouse out event listener -
This code will submit the information from the form to a php file, everything
This code load the content of the php file with the parameter: online and
This is my form: <!DOCTYPE html> <html> <head> </head> <body> <form action=register_ajax.php method=get> <input
I have code that generates this error: ** Message: pygobject_register_sinkfunc is deprecated (GstObject) Traceback
This code is from Apple's WWDC 2011 Session 318 - iOS Performance in Depth
This code in helper: def dgtags if params[:controller]=='my_controller' javascript_include_tag('dygraph-combined.js') << tag(:meta, :http_equiv => 'X-UA-Compatible',
This code works fine for FF, Safari, Chrome and IE9, but doesn't work 100%
This code works fine in <= IE7, but it doesn't work in firefox ..

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.