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 6200921
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:27:26+00:00 2026-05-24T04:27:26+00:00

$tran = START TRANSACTION;; $tran_res = mysql_query($tran); $qry_1 = INSERT INTO docList (doc_ip ,

  • 0
    $tran = "START TRANSACTION;";  

    $tran_res = mysql_query($tran);  

    $qry_1 = "INSERT INTO docList (doc_ip , doc_country , doc_ref) VALUES ('$ip' , '$country' , '$http_ref');";  
    $res_1 = mysql_query($qry_1);  
    if(!$res_1)
        die ("qry1 fail " . mysql_error() );  

    $ins_id = mysql_insert_id();  
    if(!$ins_id) 
        die ("ins id fail " . mysql_error() );  
    echo "<b>$ins_id</b>";  

    $qry_2 = "INSERT INTO docContent (doc_id , cont_date , cont_title , cont_aim , cont_obj , cont_theory , cont_sw , cont_code) VALUES ('$ins_id' , '$dt' , '$title' , '$aim' , '$obj' , '$th' , '$sw' , '$code');"; 

    $res_2 = mysql_query($qry_2);  
    if(!$res_2)
        die("qry2 fail " . mysql_error() );  `

The execution of above is returning the following error:

2 qry fail You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'login'); if($query->num_rows()>0) return $query->result_array(); } ' at line 1

In effect the execution of $qry_2 is failing, but I am perplexed by the error it is showing (there is no such code on line 1 as mentioned in the error note). Moreover, the query ($qry_2) executes properly in the MySql console.

  • 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-05-24T04:27:26+00:00Added an answer on May 24, 2026 at 4:27 am

    You haven’t posted the real query as received by the MySQL server, but I’d dare say you haven’t used mysql_real_escape_string() to inject your data into your SQL.

    (Are you trying to insert PHP code in the database?)

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

Sidebar

Related Questions

Consider the following SQL: BEGIN TRAN SET TRANSACTION ISOLATION LEVEL READ COMMITTED INSERT Bands
Query 1 CREATE TABLE [dbo].[VarArray[]](column int) Go begin tran insert into VarArray(i) select 1
I want to insert a range of values into my table create TEMPORARY TABLE
What's PLSQL (Oracle) equivalent of this SQL server snippet? BEGIN TRAN INSERT INTO mytable(content)
I want to implement an atomic transaction like the following: BEGIN TRAN A SELECT
I have a table Tran with transaction records. I have two tables, Parameters1 and
foreach (int tranQuote in transactionIds) { CompassIntegration compass = new CompassIntegration(); Chatham.Business.Objects.Transaction tran =
I am trying to execute a packageprocedure from ODP.NET C# which insert data into
I need to sort only the <Transaction-Detail> nodes (by the <tran-id> child node) of
What is difference between tran and transaction in SQL Server 2005 ? Following are

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.