Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.
Hi all, please see this major site announcement: https://www.boards.ie/discussion/2058427594/boards-ie-2026

Mysql import help

  • 25-03-2016 04:11PM
    #1
    Registered Users, Registered Users 2 Posts: 2




    Can anyone see any obvious problems with this sql file?

    It's throwing out

    " You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '-salary, accommodation_type, address, contact_number) VALUES ('اما ' at line 1"
    ????


Comments

  • Registered Users, Registered Users 2 Posts: 6,683 ✭✭✭daymobrew


    Please post the first few lines of the sql file.


  • Registered Users, Registered Users 2 Posts: 2 amalsuju


    <?php require_once('../../Connections/connection.php'); ?>
    <?php
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
    {
    $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;

    switch ($theType) {
    case "text":
    $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
    break;
    case "long":
    case "int":
    $theValue = ($theValue != "") ? intval($theValue) : "NULL";
    break;
    case "double":
    $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
    break;
    case "date":
    $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
    break;
    case "defined":
    $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
    break;
    }
    return $theValue;
    }

    $editFormAction = $_SERVER;
    if (isset($_SERVER)) {
    $editFormAction .= "?" . htmlentities($_SERVER);
    }

    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
    $insertSQL = sprintf("INSERT INTO logg (username, firstname, lastname, typename, password, age, birthdate, email, gender, civil_reg, civildate, Source, qualification, salary, source_of_salary, accommodationtype, address, contactnumber) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
    GetSQLValueString($_POST, "text"),
    GetSQLValueString($_POST, "text"),
    GetSQLValueString($_POST, "text"),
    GetSQLValueString($_POST, "text"),
    GetSQLValueString($_POST, "int"),
    GetSQLValueString($_POST, "int"),
    GetSQLValueString($_POST, "date"),
    GetSQLValueString($_POST, "text"),
    GetSQLValueString($_POST, "text"),
    GetSQLValueString($_POST, "int"),
    GetSQLValueString($_POST, "date"),
    GetSQLValueString($_POST, "text"),
    GetSQLValueString($_POST, "text"),
    GetSQLValueString($_POST, "int"),
    GetSQLValueString($_POST, "text"),
    GetSQLValueString($_POST, "text"),
    GetSQLValueString($_POST, "text"),
    GetSQLValueString($_POST, "int"));
    }
    mysql_select_db($database_connection, $connection);
    $query_logg = 'SELECT * FROM logg';
    $logg = mysql_query($query_logg, $connection) or die(mysql_error());
    $row_logg = mysql_fetch_assoc($logg);
    $totalrows_logg = mysql_num_rows($logg);

    ?>


  • Registered Users, Registered Users 2 Posts: 2,011 ✭✭✭colm_c


    Looks like your line breaks are also inserting (or trying to) hence line return character:

    'اما ' at line 1

    It also could be one of your values e.g. date depending on what you are passing in.


Advertisement