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

  • Home
  • SEARCH
  • 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 7028143
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:20:51+00:00 2026-05-28T00:20:51+00:00

mysql_query(insert into support values(‘null’,’$status’,’$sbj’,’$message’,’$userid’,’$user’,”,”,’$date’,”), $dbc) or die(‘Could not connect: ‘ . mysql_error()); $index =

  • 0
mysql_query("insert into support values('null','$status','$sbj','$message','$userid','$user','','','$date','')", $dbc) or die('Could not connect: ' . mysql_error());

$index = mysql_insert_id();
$inci = '1' . $index;

echo "$inci";

mysql_query("UPDATE support SET incidentno='$inci' WHERE index='$index'",$dbc) or die('Could not connect: ' . mysql_error());

printf("<h2>your incident id is: %d\n</h2>", $inci) ;

echo $inci;
  • 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-28T00:20:52+00:00Added an answer on May 28, 2026 at 12:20 am

    add trigger on table (use MySQL console or something similar), here is a full example with a test table names support

    CREATE TABLE `support` (
        `index` int(11) NOT NULL AUTO_INCREMENT,
        `username` varchar(100) NOT NULL,
        `incidentno` varchar(100) NOT NULL,
        PRIMARY KEY (`index`)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
    CREATE TABLE `login` (
        `username` varchar(100) NOT NULL,
        `section` varchar(100) NOT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
    
    
    DELIMITER $$
    CREATE TRIGGER `generate_incidentno` BEFORE INSERT ON `support`
    FOR EACH ROW
    BEGIN
        SET NEW.incidentno = CONCAT(CASE (SELECT section FROM login WHERE username=NEW.username)
            WHEN 'dehli' THEN '1'
            ELSE '2'
        END
        , (
            SELECT AUTO_INCREMENT FROM information_schema.TABLES
            WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'support'
        ));
    END$$
    DELIMITER ;
    
    
    INSERT INTO login VALUES ('user1','dehli'),('user2','dehli'),('user3','other');
    INSERT INTO support VALUES (NULL,'user1','');
    INSERT INTO support VALUES (NULL,'user1','');
    INSERT INTO support VALUES (NULL,'user2','');
    INSERT INTO support VALUES (NULL,'user3','');
    INSERT INTO support VALUES (NULL,'user3','');
    SELECT * FROM support;
    
    
    id  username   incidentno
    1   user1      11
    2   user1      12
    3   user2      13
    4   user3      24
    5   user3      25
    

    as you can see, all is fine

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

Sidebar

Related Questions

I'm inserting a row into a table, like so: mysql_query(INSERT INTO post(name,message,date)VALUES('$name','$message','$date')); The table
With a the code, mysql_query(INSERT INTO Messages (Message, toUser, From, Date) VALUES ('$mes','$to','$from','$date')) I'm
Code: mysql_query(INSERT INTO Account(User, Pw, email) VALUES('mysql_real_escape_string($_POST[user])', '$pw','mysql_real_escape_string($_POST[email]) ) ) or die(mysql_error()); Error: You
Right now I have this code: $mysqldate = date(time()); mysql_query(INSERT INTO permissions (date) VALUES
mysql_query(INSERT INTO fatture_servizi (id, rif_fattura, servizio, quantita, prezzo_unitario, prezzo_servizio, iva) VALUES ('NULL', '$invoice_rif', '{$services_global[$i]['service']}',
$result = mysql_query(INSERT INTO project (clientname, salesperson, prospect) VALUES ('$clientName','$salesPer','$prospectVal')); while ($row = mysql_fetch_assoc($result))
im trying to insert this query with mysql_query INSERT INTO um_group_rights (`um_group_id`,`cms_usecase_id`,`um_right_id`) VALUES (2,1,1)
I have some problem whith such mysql_query INSERT INTO table VALUES ('', CURDATE()-1) why
mysql_query(insert into mytable (flow,holderid,amount,operator,ip,product,taskid,comment)values('-1','$memberid','$sum+5','$memberid','$ip','Expertise','$taskid','Publish a problem or task') )or die(mysql_error()); I get an error
mysql_query(INSERT INTO dictionary ('word', 'definition') VALUES ('.$word.','.$definition.');) That just will not execute, when I

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.