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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T06:15:37+00:00 2026-05-30T06:15:37+00:00

$sql = INSERT INTO toplist (serverName, serverPassword, serverIp, serverPort, serverBanner, serverShortDescription, serverDescription) VALUES (‘$_POST[serverName]’,

  • 0
$sql = "INSERT INTO toplist 
       (serverName, serverPassword, serverIp, serverPort, serverBanner,
        serverShortDescription, serverDescription)
       VALUES
       ('$_POST[serverName]', '$_POST[serverPassword]', '$_POST[serverIp]',
        '$_POST[serverPort]', '$_POST[serverBanner]', 
        '$_POST[serverShortDescription]', '$_POST[serverDescription]')";

if (!mysql_query($sql, $con)) {
    die('Error: ' . mysql_error());
}

echo "The server " . $_POST[serverName] . "," . $_POST[serverIp] 
    . " has been added.";

mysql_close($con);

How can I make it so that if the entry “serverIp” does not already exist, it will add it to the database, if it does already exist, then it doesn’t do anything. Also, will this be case sensitive too? Will you be able to bypass it bY tYpInG LiKe tHiS?

  • 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-30T06:15:38+00:00Added an answer on May 30, 2026 at 6:15 am

    INSERT IGNORE … will not insert if you have a unique constraint on your column. I would lower case the string before inserting it if you want it to be case insensitive.

    http://dev.mysql.com/doc/refman/5.5/en/insert.html

    This may also be helpful.

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

Sidebar

Related Questions

SQL statement: INSERT INTO order (`ORDER_ID`,`SALE_CODE`,`CREATED_AT`,`UPDATED_AT`) VALUES ('2646253286','HPHS20','2009-07-11 12:07:40','2009-07-11 12:07:40') Error: You have an
I'm looking for the db2 equivalent of T-SQL's: INSERT INTO People (Surname) VALUES ('O''Hara');
Like: insert into table (col) values (N'multilingual unicode strings') I'm using SQL Server 2008
error: could not insert: [NHibernateExperiment.Domain.Customer][SQL: INSERT INTO Customer (FirstName, LastName, Address) VALUES (?, ?,
I Have a file source.sql INSERT INTO `Tbl_ABC` VALUES (1, 0, 'MMB', '2 MB
If I have the following SQL: INSERT INTO sometable (someintcolumn) VALUES ('1') This will
I have a temporary table #PORTAL_PRODUTOS, on sql manager I can insert values into
I'm writing SQL (for Oracle) like: INSERT INTO Schema1.tableA SELECT * FROM Schema2.tableA; where
I have a SQL Insert query inside a stored proc, for inserting rows into
I've got an SQL query that looks like this: INSERT INTO DB..incident ( incident_number

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.