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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:53:41+00:00 2026-06-16T04:53:41+00:00

hello i am going to insert some data into data base. There are no

  • 0

hello i am going to insert some data into data base.
There are no my sql error but data not inserted into data base. My code is:

 mysql_query("SET CHARACTER SET 'utf8'");
  mysql_query("SET character_set_results=utf8");


if (isset($_POST['Submit'])){ 
$category= $_POST['category'];

if ($category==1) {$cat="rf_power";
$sub_cat=$_POST['power']; $dur="p_duration";}
if ($category==2) {$cat="rf_bts";
$sub_cat=$_POST['BTS']; $dur="b_duration";}
 if ($category==3) {$cat="rf_transmission";
 $sub_cat=$_POST['transmission']; $dur="t_duration";}
 if ($category==4) {$cat="core_network";$sub_cat=$_POST['core']; $dur="duration";}
 if ($category==5) {$cat="daisy_chain";
 $sub_cat=$_POST['daisy']; $dur="d_duration";}

 $dateid=date('Y-m-d');
 $s_name=mysql_real_escape_string($_POST['s_name']);
 $location=mysql_real_escape_string($_POST['city']);
 $alarm_type=mysql_real_escape_string($_POST['a_type']);
 $severity=mysql_real_escape_string($_POST['severity']);
 $reason=mysql_real_escape_string($_POST['reason']);
 $shift_operation=mysql_real_escape_string($_POST['shto_do']);
 $system_operation=mysql_real_escape_string($_POST['syto_do']);
 $start_time=mysql_real_escape_string($_POST['date1']);
 $end_time=mysql_real_escape_string($_POST['date2']);
 $dur=mysql_real_escape_string($_POST['date3']);
 echo $dateid;
 echo $s_name;
 echo $sub_cat;
 echo $location;
 echo $alarm_type;
 echo $severity;
 echo $start_time;
 echo $end_time;
 echo $dur;
 echo $reason;
 echo $shift_operation;
 echo $system_operation;
 echo $cat ;

  $sql = "INSERT INTO ".$cat." (dateid,system_name,sub_cat,location,alarmtype,severity,start_time,end_time,duartion,reason,shift_operation,system_operation)
    VALUES ('$dateid','$s_name','$sub_cat','$location','$alarm_type','$severity','$start_time','$end_time','$dur','$reason','$shift_operation','$system_operation')";
 }

all prints normal by echo. i think the error is for the “INSERT INTO “.$cat.” . $cat is right in here?

  • 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-16T04:53:42+00:00Added an answer on June 16, 2026 at 4:53 am

    From the posted code it seems your query is not being executed, but stored inside $sql and sitting there.. From the code there is nothing to actually execute the query, I have added this in the bottom. the addition of mysql_query($sql); Will run the script against your selected database

     $sql = "INSERT INTO $cat (dateid,system_name,sub_cat,location,alarmtype,severity,start_time,end_time,duartion,reason,shift_operation,system_operation)
            VALUES ('$dateid','$s_name','$sub_cat','$location','$alarm_type','$severity','$start_time','$end_time','$dur','$reason','$shift_operation','$system_operation')";
        mysql_query($sql);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello i'm going print sum of time from my sql but i could not
hello i'm going to get array data from for. i have a code but
Hello i'm going to check duplicated data from selected data but my code is
Hello I need some help understanding what is going on in this assembly code:
Hello there I have slight problem and not sure where im going wrong with
Hello I have a main app that is going to have some plugins in
Everything is going well with my ajax code when passing variables, lets say hello
I have following list: mylist = ['Hello,\r', 'Whats going on.\r', 'some text'] When I
I have a pre-constructed array created from some test data as I have not
I am going through the Android Hello World , but when I go to

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.