Search the Community
Showing results for tags 'mysql'.
-
Most of my work revolves around mail merging in Adobe InDesign for some PDF generation. The current steps are as follows: Enter data in MS Excel's appropriate columns, with one column dedicated to image URL (if any). Exporting complete worksheet in .csv file format. Updating .csv link in Adobe InDesign Finding row no. of the newly added / entered rows Mail-merging data in Adobe InDesign Now the issue I'm facing is of data entry. With scope of increasing workload, I'm thinking of adding another terminal for entry of data to the excel worksheet but with this comes another issue of handling concurrent users in same excel sheet. Also, I want the files to be backed up online. I tried using OneDrive as a central location to back up but it causes huge problem when two people start working on the same file and click 'save'. On 'saving' a file, OneDrive finds differences and instead of merging the edits intelligently, OneDrive creates another copy of the excel file and this creating confusion. So I am wondering if: There can be a way to have lightweight Oracle installed in other systems and Oracle server / main database installed in the main machine so that multiple people can work on same database concurrently without worrying about redundancies? Such Oracle / MySQL or any suitable lightweight SQL database can be accessed online Such database can be backed up online Is there a tool to import data directly from Oracle into Excel? or if not, Is there a way to convert data directly from Oracle database (filtered via SQL query) into .csv? If there is an option to work on Database such as Oracle / MySQL / MSSQL / Postgre or any that can help me export .csv file for an extract / SELECT query, then I is there a way to enter it using some GUI instead of command line?
-
Hello! I have a question regarding some tables I want to join to retrieve information about some time spent on different projects. I have three tables: projects p COLS: | id(PK) | project_id | project_name | deleted | hourly_rate | issues i COLS: | id(PK) | issue_id | issue_name | is_open | project_id | internal_note | intervals iv COLS: | id(PK) | manuscript_person_id | issue_id | interval_id | seconds_elapsed | Now - I need to join these three together so I get total elapsed seconds in a project based on the issues in the given projects. The the `p.project_name` must not start with the prefix "K - ". The `i.internal_note` must not contain the letters in the following order "SKIF" I have written a query that fetches all projects that doesn't contain the prefix "K - ": SELECT p.project_id, p.hourly_rate FROM projects p WHERE p.project_name NOT LIKE "K - %" And I have also written a query that finds all issues in those projects that does not have the "K - " prefix and internal_note does not contain "SKIF" SELECT i.issue_id, i.internal_note FROM issues i JOIN projects p ON i.project_id = p.project_id WHERE project_name NOT LIKE "K - %" AND i.internal_note NOT LIKE "%SKIF%" My problem now lies in tying these together with the summed up elapsed seconds from intervals grouped first by i.issue_id and then by p.project_id in the end so I will end up with a result that looks like so: | p.project_id | p.hourly_rate | some_join.elapsed_seconds | ----|--------------|---------------|---------------------------| 1 | 836 | 900 | 367929 | ----|--------------|---------------|---------------------------| 2 | 928 | 950 | 367929 | ----|--------------|---------------|---------------------------| 3 | 1125 | 942 | 367929 | ----|--------------|---------------|---------------------------| 4 | 1337 | 827 | 367929 | ---------------------------------------------------------------- etc..... How would one suggest to attack this problem?
-
Hello everyone, 0down votefavorite Hello everyone, When trying to start MySQL it starts and tells me it's running, a few seconds later I get this: 17:26:09 [mysql] Error: MySQL shutdown unexpectedly. 17:26:09 [mysql] This may be due to a blocked port, missing dependencies, 17:26:09 [mysql] improper privileges, a crash, or a shutdown by another method. 17:26:09 [mysql] Press the Logs button to view error logs and check 17:26:09 [mysql] the Windows Event Viewer for more clues 17:26:10 [mysql] If you need more help, copy and post this 17:26:10 [mysql] entire log window on the forums The log file contains this: 2015-11-10 15:26:56 10fc InnoDB: Warning: Using innodb_additional_mem_pool_size is DEPRECATED. This option may be removed in future releases, together with the option innodb_use_sys_malloc and with the InnoDB's internal memory allocator. 2015-11-10 15:26:56 4348 [Note] InnoDB: Using mutexes to ref count buffer pool pages 2015-11-10 15:26:56 4348 [Note] InnoDB: The InnoDB memory heap is disabled 2015-11-10 15:26:56 4348 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions 2015-11-10 15:26:56 4348 [Note] InnoDB: Memory barrier is not used 2015-11-10 15:26:56 4348 [Note] InnoDB: Compressed tables use zlib 1.2.3 2015-11-10 15:26:56 4348 [Note] InnoDB: Not using CPU crc32 instructions 2015-11-10 15:26:56 4348 [Note] InnoDB: Initializing buffer pool, size = 16.0M 2015-11-10 15:26:56 4348 [Note] InnoDB: Completed initialization of buffer pool 2015-11-10 15:26:56 4348 [Note] InnoDB: Highest supported file format is Barracuda. 2015-11-10 15:26:57 4348 [Note] InnoDB: 128 rollback segment(s) are active. 2015-11-10 15:26:57 4348 [Note] InnoDB: Waiting for purge to start 2015-11-10 15:26:57 4348 [Note] InnoDB: Percona XtraDB (http://www.percona.com) 5.6.26-74.0 started; log sequence number 1835027 2015-11-10 15:26:57 6140 [Note] InnoDB: Dumping buffer pool(s) not yet started 2015-11-10 15:26:57 4348 [Note] Plugin 'FEEDBACK' is disabled. 2015-11-10 15:26:57 4348 [Note] Server socket created on IP: '::'. 2015-11-10 15:26:57 4348 [Note] Event Scheduler: Loaded 0 events 2015-11-10 15:26:57 4348 [Note] C:\xampp\mysql\bin\mysqld.exe: ready for connections. Version: '10.1.8-MariaDB' socket: '' port: 3306 mariadb.org binary distribution 2015-11-10 15:27:11 5152 [Note] C:\xampp\mysql\bin\mysqld.exe: Normal shutdown 2015-11-10 15:27:11 5152 [Note] Event Scheduler: Purging the queue. 0 events 2015-11-10 15:27:11 5732 [Note] InnoDB: FTS optimize thread exiting. 2015-11-10 15:27:11 5152 [Note] InnoDB: Starting shutdown... 2015-11-10 15:27:13 5152 [Note] InnoDB: Shutdown completed; log sequence number 1835037 2015-11-10 15:27:13 5152 [Note] C:\xampp\mysql\bin\mysqld.exe: Shutdown complete Does anyone know how to fix this? - Thank you Is this anything to do with the fact that Xampp is intalled on my secondary harddrive? It's onstalled on my (E:) instead of my (C:) ??
-
Always get this error,please help I am using the Mac OS X 10.11 (x86, 64-bit), DMG Archive download
-
So i don't know if im posting in the right parent topic, please excuse me if i am. But i need some help when it comes to this php error i,m getting much information is needed please and thank you, the error i,m getting is PHP Notice: Undefined variable: servername in C:\inetpub\wwwroot\Admin5\WOconf.php on line 11 My page code bellow $servername = "localhost"; $username = "******"; $password = "************"; $dbname = "****"; // Create connection $conn = mysqli_connect($servername, $username, $password, $dbname); // Check connection if (!$conn) { die("Connection failed: " . mysqli_connect_error()); } $clientname = $_POST['client_name']; $accountnumber = $_POST['account_number']; $contactnumber = $_POST['contact_number']; $address = $_POST['address']; //$servicetype = $_POST['service_type']; //$serialnumber = $_POST['serial_number']; //$brand = $_POST['d_brand']; $devicetype = $_POST['device_type']; $devicemodel = $_POST['device_model']; $loggeddate = $_POST['logged_date']; $requesteddate = $_POST['requested_date']; $cost = $_POST['cost']; $techID = $_POST['techID']; $problemcomment = $_POST['problem_comment']; $email = $_POST['user_email']; $sql = "INSERT INTO work_orders (clientname, accountnumber, contactnumber, address, devicetype, devicemodel, loggeddate, requesteddate, cost, techID, problemcomment, email) VALUES ('$clientname', '$accountnumber', '$contactnumber', '$address','$devicetype', '$devicemodel', '$loggeddate', '$requesteddate', '$cost', '$techID', '$problemcomment', '$email')"; if (mysqli_query($conn, $sql)) { echo "New record created successfully"; } else { echo "Error: " . $sql . "<br>" . mysqli_error($conn); } mysqli_close($conn); ?>
-
Hey there! I've worked with MSSQL for a couple of years now but I never worked with anything like this :Þ I moved over to MySQL because the system I'm working with only supports MySQL. My question is, how do I store a 'total activity' value? For instance: "32 days, 12 hours, 15 minutes and 9 seconds" total. How do I store this so I can add like 5 minutes to it later on? Maybe a Integer, or a DateTime kind of object? Can anybody help me out, any tips are helpfull!
- 5 replies
-
- mysql
- total time
-
(and 2 more)
Tagged with:
-
Hey guys, I am hoping you can help me out! I am new to MySQL and PHP (still learning), and I am trying to figure out a way to incorporate a simple "check" system in my test website to allow the user to go to a section in the website if the value they entered within the "check" field is a value in the MySQL database. I can picture how I need to do it in Java (I am pretty fluent in that), but using this is mind boggling to me. Let me explain it a little bit better. My goal is to have select people given one unique number (4394 for an example), and once they go into a special page on my website, they are given the opportunity to type in the number they are given, sort of like a password. If the value they wrote is in the MySQL database, then they are granted access to the next page. If not, they are brought to a failed page (can literally be anything). The reason I need it to be a database is because the goal is to give many people (1000+) a special number unique to them, while giving me the opportunity to easily add additional numbers for new people. In Java, I would do this through an array which has the values saved as strings in each element, then once the user inputs their number, it would traverse the array and run a simple if statement. If the user input value is equal to a string within an element of the array, then it will break the loop and bring the user to another page. If the user input is not equal to a string within the array, then it would just say "Error". Like I said, I am incredibly new to all of this, so this may very well be the way of doing in MySQL and PHP, but I have no clue. Thanks for any help you can give me!
-
Hi, I have been working on a ticket booking application and I am currently at a standstill. I am trying to display an overall stats of all the tickets that are completed per month. When a ticket is completed the following information is logged in the database that I will need to allow to filter so my manager can see how many tickets per engineer has completed on a monthly basis. (Picture below) The two main columns for the filtering will be 'CompletedBy' and 'CompletedOn'. I find that "SELECT MONTH(CompletedOn) m, YEAR(CompletedOn) y, COUNT(*) FROM tickets WHERE CompletedBy=@username GROUP BY y, m" Works perfectly in SQL to display what I need but having a bit of trouble trying to get the data from the 'GROUP BY' into something like a variable so I can use on a bar chart that displays the tickets completed per month. using (MySqlConnection conn = new MySqlConnection(connectionString)) { string getAmountOfTicketsJan = "SELECT MONTH(CompletedOn) m, YEAR(CompletedOn) y, COUNT(*) FROM tickets WHERE CompletedBy=@username GROUP BY y, m"; MySqlCommand cmdTicket = new MySqlCommand(getAmountOfTicketsJan, conn); cmdTicket.Parameters.AddWithValue("@username", chartUser); try { conn.Open(); int test = Convert.ToInt32(cmdTicket.ExecuteScalar()); CommonGlobalVariables.graph_jan = test; conn.Close(); } catch (Exception error) { MessageBox.Show("Exception: " + error.Message); return; } MessageBox.Show("Month 1 = " + CommonGlobalVariables.graph_jan); } The code above works but it grabs the data from the first column (being month). How can I get data from the third column (which is the total) in my case. I can elaborate if I explain very poorly lol. Thanks, Brandon
-
I will add protection against injection as soon as I get everything actually working Echoing `$hash` gives me the value stored into the DB without issue Echoing `$user` gives me the value stored into the DB without issue Echoing `$password` gives me the value stored into the DB without issue So what is going here? Registration $password = '$_POST[user_password]'; $hash = password_hash($password, PASSWORD_DEFAULT); $sql="INSERT INTO users (user_first,user_last,user_name,user_email,user_photo,user_password)VALUES('$_POST[user_first]','$_POST[user_last]','$_POST[user_name]','$_POST[user_email]','$_POST[user_photo]','{$hash}')"; Login mysqli_select_db($con,$DATABASE); //check logged in if ($_SERVER["REQUEST_METHOD"] === "POST") { $user = $_POST['user_name']; $password = $_POST['user_password']; $hashobj = mysqli_query($con,"SELECT user_password FROM users WHERE user_name = '$user'"); $hasharray = mysqli_fetch_assoc($hashobj); $hash = implode($hasharray); if (password_verify($password,$hash)) { echo 'Password is valid!'; } else { echo 'Invalid password.'; } } mysqli_close($con); ?>
-
I have done my research and all I found is using JOIN instead. But that only works if the data inside the IN clause also came from the database itself (meaning came from different table). But that is not my case at all. Basically a user will enter a list of id and when submitted, I should only SELECT the records that has the same ID as the user input. Sounds simple right? Yes, it is. In fact I already did it using: SELECT * FROM `table` WHERE `id` IN ({implode(", ", $array)}) So what the problem? Well the id that the user inputs contain a minimum of 5000 ids. That translates into 5000 ORs when inside IN clause. Which takes like 20min in my case, which is insane. Please help EDIT: The data inside IN clause is just an example because obviously... (and I cant paste all 5000 of them here) SELECT * FROM `t_student` AS `TStudent` LEFT JOIN `t_course` AS `TCourse` ON `TCourse`.`student_id` = `TStudent`.`id` LEFT JOIN `t_payment` AS `TPayment` ON `TPayment`.`course_id` = `TCourse`.`id` LEFT JOIN `t_employee` AS `TEmployee` ON `TEmployee`.`student_id` = `TStudent`.`id` WHERE ( `TStudent`.`country_id` = 0 OR `TStudent`.`country_id` = '' OR `TStudent`.`country_id` IS NULL OR `TStudent`.`country_id` != 1 ) AND `TStudent`.`id` IN ('264', '261', '260', '259', '274', '263', '280', '262', '272', '268', '276', '278', '279', '273', '269', '267', '277', '266', '271', '265', '275', '270', '283', '239', '40', '41', '42', '39', '238', '237', '236', '134', '108', '101', '98', '102', '103', '97', '91', '105', '92', '109', '99', '100', '106', '107', '286', '94', '96', '93', '95', '104', '90', '89', '293', '235', '61', '258', '113', '112', '289', '116', '115', '111', '295', '114', '232', '233', '234', '22', '20', '21', '284', '17', '16', '19', '18', '229', '230', '231', '227', '226', '228', '282', '187', '188', '225', '224', '242', '241', '243', '46', '47', '45', '240', '27', '256', '257', '62', '63', '64', '65', '223', '222', '254', '255', '221', '290', '220', '219', '214', '217', '218', '215', '216', '213', '131', '133', '132', '211', '212', '209', '210', '207', '208', '205', '206', '204', '291', '31', '30', '29', '294', '24', '25', '23', '26', '110', '203', '119', '120', '5', '3', '7', '10', '9', '6', '12', '11', '13', '4', '8', '202', '118', '117', '201', '200', 'STU56e0f8268c65b', 'STU56e0f7714222e', '37', '38', '88', '34', '36', '35', '32', '33', '199', 'STU56e0f8aed57ad', '126', '129', '130', '128', '127', '159', '198', '184', '160', '178', '285', '179', '173', '186', '180', '166', '183', '174', '185', '175', '172', '162', '171', '164', '167', '161', '170', '169', '182', '177', '168', '176', '165', '181', '163', '146', '137', '288', '136', '138', '145', '149', '148', '144', '147', '140', '143', '142', '141', '139', '135', '287', '48', '44', '43', '69', '60', '56', '57', '58', '59', '86', '73', '85', '80', '83', '87', '77', '76', '75', '78', '82', '84', '79', '74', '81', '197', '196', '66', '67', '68', '253', '195', '15', '194', '192', '193', '49', '52', '54', '55', '50', '51', '53', '189', '191', '190', '292', '245', '250', '251', '248', '252', '246', '247', '244', '249', '121', '70', '158', '153', '157', '155', '154', '152', '151', '150', '156', '28', '122', '124', '123', '125', '14', '2', '71', '72', 'STU56e253ae85ed1', 'STU56df8abad4074', 'STU56d79c34289d4', 'STU56e65379b777a', 'STU56d92b254115f', 'STU56d04af025643', 'STU56d3e45d0ced3', 'STU56e652bac5f7e')
-
Ok I have a Centos Server running with several databases. Mysql is running fine, I can use phpmyadmin, all my databases are working, I have several scripts running every couple hours that pull from these databases, No problem. Upon trying to diagnose an issue with my postfix mail server throwing a "too many mysql connections" error(not te direct issue I am having). I ran "# service --status-all " and in my list of services mysqld is not there. also trying "service mysqld status" returns nothing found. but If I run "mysql -p MYPASS" I am logged into my mysql and can access my Databases. Also I went and double checked my scripts to make sure I was using localhost as the server and I am indeed using "localhost" so I know that mysql has to be running on this server... I am at a loss for trying to figure out where the hell Mysql is!!!!! Please anyhelp would be much appreciated. this is confusing the hell out of me, and usually mysql is pretty good to me. *NOTE: I did not do the installation of mysql on this server, so I am unaware of the process they took and where installation files where put, rebuilding or reinstalling mysql is out of the question at this point. I have about 50+ DBs running on the server and moving them all would mean way to much downtime. thanks again for any advice or help
-
Running the attached code. Getting this error: " Notice: Undefined index: Description in /home/frcahost/public_html/search.php on line 41Description:" Why? Also, is there anything else that should be fixed in the code? search.php
-
I have an inline datepicker(calendar) on my website. when i load the page, i do a query to fetch all events from mysql database. For every date fetched from the database, i change the color style of the date dynamically. Here's the code i'm using : var datetoday = new Date().getDate(); var date = $("#inline-datepicker .datepicker .datepicker-days table tbody tr>td:contains([datefromthequery])").html(); if(date == datetoday){ //change the color style of the date to red. }else{ // change the color style of the date to green } Here's the problem. When i insert an event with a single digit date and reload the page. All dates that contain that single digit date inserted are changed in style. Can anyone help me do the workaround for this bug? Thanks.
-
So for the last 2 months i have been working on a multiplayer game and i just got myself a VPS to run my multiplayer handler on. I use a MySQL database to save all the user information and on the VPS i can connect to my MySQL server without any problems(because the database is hosted on my VPS). Now i want my website to connect to the database on my MySQL server but i cannot connect to the host... http://prntscr.com/a5bfd7 (screenshot from websites my error page). The config is the same as the one i use to make my multiplayer handler connect to the database but instead of using 'localhost' i use the IP-adres of the VPS. So the problem is, i cant get my website to connect to my MySQL database. i hope u guys know the answer Some more information: OS on my VPS: Windows server 2012 R2 MySQL server version: 5.7
- 9 replies
-
- mysql
- windows server r2
-
(and 1 more)
Tagged with:
-
Hi, I want to create a database which stores information about computers (user, computer name, serial, etc) and I've decided I will do it via a website to make it easier to use. I've started researching into MySQL and what not but I am having trouble to figure out exactly how to do it. So I've got a few questions; - Can I host a MySQL server locally to test the database? - How do I actually get a MySQL server setup? - Any tips before I start? Thanks.
-
Hello, Like a lot of other people, I'm using MySQL as my data storage engine. And I assumed that it was basically a nice tool to edit something similar to a CSV file. So I assumed that all my data would simply be kept in some file. But when I started looking for where those files are stored (/var/lib/mysql) I noticed that there are multiple files with multiple extensions. What are those files (.frm , .opt , .myd , .myi) and what role do they play in making my database work? Thanks in advance!
-
So, my boss is making me build a LAN-website for all the employees to access important data for the functions they make (like; currency exchange tables, dead-lines, forms, news, etc) and also, he want me to make the clients data, currently saved in an excel database, accessible in that web page. Now, import data from excel to the mysql db it's not that hard (save as csv and then import that, at least it sounds easy), but I don't know how I can make all that data accessible in the web page without it being a mess or ugly. Want I was thinking (more like dreaming) to do it's a section with entries for each client (the id and name of it), a search bar to filter the names, and then, when click in the client name, display all the client data (info, tasks, dead-lines, etc) This sound great but I have no idea of how to make this, like, 0 idea, so, if you could help me make out something... Thanks in advance
-
I'm having difficulties selecting and displaying images i've saved in my database with longblob. there are a lot of examples on google that presumably work but after trying them all, nothing works. this is a part of my code: $sql = "SELECT teamID, name, date, managerID, points, logo FROM team;"; if(!$result = $mysqli->query($sql)){ die('There was an error running the query [' . $mysqli->error . ']'); } echo '<div>'; echo '<table border="1">'; while($row = $result->fetch_assoc()) { echo '<tr> <td>'.$row['teamID'] . '</td> <td>'.$row['name'] . '</td> <td>'.$row['date'] . '</td> <td>'.$row['managerID'] . '</td> <td>'.$row['points'] . '</td> <td>'.$row['logo'] . '</td> </tr>'; } echo '</table>'; echo '</div>'; what's wrong and why doesn't it work? I used phpmyadmin to select an image and save it into the database, firstly i connected to it and then wanted to display a table of teams. But as soon as i add blob to the mix it doesn't work. Without it everything works and after that i just get a table with random signs instead of a picture. What could be the problem?
-
So I am getting this fatal error. and this is my code //Add user if not in DB $SteamID = $_SESSION['LOGINDATA']; $query = "SELECT EXISTS(SELECT 1 FROM `userdata` WHERE `steam_id`=$SteamID"; $adduserquery = $dbc->prepare($query); $adduserquery->execute(); $adduserqueryresult = $adduserquery->fetch(PDO::FETCH_ASSOC); echo "Result is: " . $adduserqueryresult; Why is this error coming.
-
I currently have a database full of data, with tags written to them. But just to find something. I need go search down the whole database which contains over 30000 links. So, is there a way to create a simple search engine for my database. And this might sound stupid but my database is just a MySQL file with links arranged like this: INSERT INTO `searchengine` (`id`, `title`, `description`, `url`, `keywords`) VALUES My database is connected to my server and I would like to be able to access it using the web. So the searchengine has to be on the web.
-
So it is finally black Friday, I've decided to purchase a new PC for programming. To be specific, programming server applications that involves running an Oracle's Weblogic server, MySQL servers and Eclipse. A good graphics card is totally not required, since I will just watch some videos(not 4K) on a daily bases. So a integrated or a very weak graphics card that works is fine. What I mainly concerned on for my build is which CPU I should get. A few CPU comes to my mind are: Intel i7-4770K Intel i7-6700 AMD FX-9590 AMD FX-8350 Am I on the right track? Please do suggest some other great CPUs for my situation thank you (This is my first post here )
- 1 reply
-
- cpu
- programming
- (and 6 more)
-
Alright so currently I have created a PHP script that displays records from a MySQL database as 3 columns but I want the data echo'd by the PHP script (Inside div elements) to update dynamically as the database gets new data. The PHP Script: <?php // Connection script: include 'connect.php'; //Query $sql1 = "SELECT * FROM item"; $result = $conn->query($sql1);?><!DOCTYPE html><html><head> <link rel="stylesheet" type="text/css" href="style.css"> <title>Record Display</title></head><body> <div id="item-wrapper"> <?php $item_num = 0; // total number of records $num_records = mysqli_fetch_row($result); while ($item = mysqli_fetch_assoc($result)){ if ($item_num % 3 == 0){ ?><div class="left_column"><?php } // If its the second column of 3 write the div middle_column class else if ($item_num % 3 == 1){ ?><div class="middle_column"><?php } // If its the second column of 3 write the div right_column class else if ($item_num % 3 == 2){ ?><div class="right_column"><?php } ?><div class="item"><?php echo $item['displayName']; ?></div></div> <?php $item_num ++; } ?> </div></body></html> So my question is what would be the best method for implementing this? Thanks.
-
I have the following query and its returning the result of resource id #4; $account = mysql_query("Select type from adminaccounts where username='$username'") or die(mysql_error()); If I run the query in mysql the result is "admin" as I require. After doing some reasearch I am aware that resources are special. Could you please tell me how I could change this to just display the "admin" that I need for further if statements. thanks, Lachie
-
Alright everyone, i'm just starting PHP and SQL... I want to have a textbox and a submit button to be stored in a Database in MySQL. For some reason it's not working, can anyone take a look at the PHP and tell me if there's something wrong? Thanks HTML: <!DOCTYPE html><html><body><center><form action="action_page.php" method="post">Target:<br><input type="text" name="target1" value=""><br><br><input type="submit" value="Submit"></form> </body></html> PHP: <?php$servername = "serverIP";$username = "root";$password = "mysqldbpassword";$dbname = "mysql";// Create connection$conn = new mysqli($servername, $username, $password, $dbname);// Check connectionif ($conn->connect_error) { die("Connection failed: " . $conn->connect_error);} $sql = "INSERT INTO db ('name')$VALUES ('target1');if ($conn->query($sql) === TRUE) { echo "New record created successfully";} else { echo "Error: " . $sql . "<br>" . $conn->error;}$conn->close();?>
-
Hey all, I tested this and i believe it works but i think it may be wrong. Can anyone skilled in creating events help me correct the code. Thanks! What i want to achieve: It updates a field (flag) in a table (mytable) with a value of 0 after a certain time (6 hours and 10 minutes from when it was created) then removes itself from the scheduler. So i click a button, it creates the event and after 6 hours and 10 minutes the event sets flag = 0 and removes itself. Code: CREATE EVENT myevent ON SCHEDULE EVERY 6 HOUR STARTS CURRENT_TIMESTAMP + INTERVAL 6 HOUR + INTERVAL 10 MINUTE ENDS CURRENT_TIMESTAMP + INTERVAL 6 HOUR + INTERVAL 11 MINUTE DO UPDATE mytable SET flag = 0