Hello i have a database which users make groups or send messages to other registered, in our project, users. So you have messages as M,users as U, groups as G. So you want to show all updates that happen in these tables WHERE (uid - thats the user id column on U table.). All tables have CREATED as datetime column. Users yable is uid on messages is uid_fk and to groups uid_fk. Can i do that with a single statement or do i need to do anything else?

Member Avatar
Member Avatar
+0 forum 2

Hello i am getting an error on a CASE WHEN THEN syntax on my mySql SELECT DISTINCT u.uid,c.c_id,u.name,u.profile_pic,u.username,u.email,c.time FROM conversation c, users u, conversation_reply r CASE WHEN c.user_one = '99' THEN c.user_two = u.uid WHEN c.user_two = '99' THEN c.user_one= u.uid END AND ( c.user_one ='99' OR c.user_two ='99' ) AND u.status='1' AND c.c_id=r.c_id_fk AND u.uid<>'1'ORDER BY c.time DESC LIMIT 15 #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'CASE WHEN c.user_one = '99' THEN c.user_two = u.uid WHEN c.user_t' at …

Member Avatar
Member Avatar
+0 forum 4

Hi guys, This is my first post and so glad to start sharing the knowledge. I am using Mysql database with VB.NET and I have this code : Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim str As String = "Server=localhost;Port=3306;Database=testdb;Uid=root;Pwd=password" Using con As New MySqlConnection(str) Dim query As String = "select * from testdata where rfid_tag='" & TextBox3.Text & "' and Date_serve<= '" & Date.Now.ToString("yyyy-MM-dd ") & "' and Start_Time<= '" & Date.Now.ToString("HH:mm:ss ") & "' and End_Time>= '" & Date.Now.ToString("HH:mm:ss ") & "' or amount_serve='' " Dim cm As New MySqlCommand(query, con) con.Open() Dim rd …

Member Avatar
Member Avatar
+1 forum 2

What's the difference between LCASE() and LOWER() in MySQL? I found places on the web that said they're similar but not a synonym for each other, so I'm not sure what the differences are?

Member Avatar
Member Avatar
+0 forum 1

Previously used winXP operating system running normally (very good) when switching to win7 operating system, this error, read errors from the SQL Server data, what is the error ? http://www.mediafire.com/view/4q5ux6e66ds4avb/ErrorOpenSQL.jpg/file

Member Avatar
Member Avatar
+0 forum 1

I need help with implementing MySQL transactions with PHP. Specifically, I'm confused between the flags `WITH CONSISTENT SNAPSHOT`, `READ WRITE`, and `READ ONLY`, what their differences are, and how they relate to table locking. I already read the MySQL reference manual but I'm still confused.

Member Avatar
Member Avatar
+2 forum 6

If a bulk MySQL insert takes 5 minutes to complete, and one of the columns in the table is a TIMESTAMP column with a default value of CURRENT TIMESTAMP, will the timestamps of the rows that were inserted be reflective of the entire 5 minutes, or will they all default to the same timestamp from beginning or the end of the query? The bulk insert exists within a transaction.

Member Avatar
Member Avatar
+0 forum 3

Hi, I have installed Oracle 11g (latest version 11.2.0.1.0) on my system. During the installation it didnt ask me to set username or any password. I'm unable to start sql plus because i dont have the username and password. Can anyone tell me what is the default username and password or what is the default password for SYS or SYSTEM? Thanks, VC

Member Avatar
Member Avatar
+0 forum 46

I want to create a php function that i can use to get a particular user details and display the info gotten in my ProfileActivity when a user profile is been clicked in my app. so i wrote this php code to get user details from my database but when i run the code nothing is returned in my browser. please what could be causing this? <?php require("config.php"); function getdetails($id) { $array = array(); $q = mysql_query("SELECT * FROM 'users' WHERE 'id'=".$id); while($r = mysql_fetch_assoc($q)) { $array['id'] = $r['id']; $array['name'] = $r['name']; } return $array; } function getId($name) { $q …

Member Avatar
Member Avatar
+0 forum 2

hello everyone im taking database course this year and it's my first time to take it so i need help how to draw a ERD for following busniess case AND IF there many to many relation how i can establish a new relation ! Entity (Artist ) Attribute : death , DOB, the nationality. ---------------- Entity (museum ) Attribute: location , specialty . --------------- Entity: (paintings) Attribute: size of canvas, year of painted, tittle , style ----------------- Relation between Artist and paintings : Paint Relation between paintings and museum : Display An art researcher has asked you to design a …

Member Avatar
Member Avatar
+0 forum 1

Hello! I have a problem with a MySQL database that I haven’t been able to solve no matter how much I tried, either with internet guides or with free tools. I really don’t want to pay hundreds of dollars to a company so please, if anyone knows of a solution, help me because I’m desperate. I was running XAMPP 7.1.22 where I had said database and I decided to install XAMPP 7.2.10 without backing up the database. After that, the site wasn’t working so I figured the problem was the database. And indeed PHPMyAdmin wouldn’t recognize it. I reinstalled the …

Member Avatar
+0 forum 0

I read several forums questions related to SQL database corruption. As we all know, backup is the best way to repair SQL database. What a user will do when backup copy is also corrupted or updated bacjup is not available? Is DBCC CHECKDB Repair option (Repair_Allow_Data_Loss) safe?

Member Avatar
Member Avatar
+0 forum 1

Hi to all! I'm fairly new to using High availability group and i've been having issues with storage space from my Logs drive from my primary server.. I just want to know why is my Log file not shrinking after I do backups(Full) on the primary server.. also, another question.. can I do the backup on my secondary server before shrinking my Logs on the primary? the reason I want to do this because my primary server has a database primarily used for Production(MES) and I don't want any downtime on their part.. Thanks in Advance.

Member Avatar
Member Avatar
+0 forum 4

Hi Guys! I have a website but we don't host in GoDaddy or any hosting website, because we use SQL database. And we have a large database that we are using , the website is for productions. We store a lot of data. We use the IP address because we port forward it so that we can use it anywhere. Now, we are worried because we are exposing our IP address outside, and it might be the reason for hackers or any attacks to come to us. Can you help me or give me an Idea how can I change …

Member Avatar
Member Avatar
+0 forum 15

Hello i have a project that uses firebase but i want to make connect to my MySql database on xampp. Any idea what to do?

Member Avatar
Member Avatar
+0 forum 1

Hi there, i'm trying to create a class schedule for subjects where students can view what's available and later on book a position in a class. Here are the images of what i'm trying to achieve: https://imgur.com/a/Ie4XO I want to retrieve the table name and ID of students that have booked a place in a class from the subject table and show them in the main table in the correct time slot. Is there any online resouces which can help me achieve this? i have already created the tables in my database, the tables but having issues on how to …

Member Avatar
Member Avatar
+0 forum 6

When i run the statement below i am getting a number of xxx.xxxx can anyone help me change this to two DP? (SELECT sum(oht_net) FROM order_header_total JOIN order_header ON oh_id = oht_oh_id WHERE oh_cd_id = cd_id AND oh_sot_id = 1 AND DATEPART(yyyy, oh_datetime) = (SELECT DATEPART(yyyy, GETDATE()) -1))

Member Avatar
Member Avatar
+0 forum 2

I am trying to select all rows from all tables in the database when a column equal a given name. I have like many tables with same structure and columns. I have written this piece of code but it throws an error. SELECT GROUP_CONCAT(qry SEPARATOR ' UNION ') INTO @sql FROM ( SELECT CONCAT('SELECT * FROM `',table_name,'` where Name like ''','sally%','''') qry FROM ( SELECT distinct table_name FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = 'db_customers' AND column_name LIKE 'Name' ) A ) B; PREPARE s FROM @sql; EXECUTE s; DEALLOCATE PREPARE s; This is the error I am getting. I am aware …

Member Avatar
Member Avatar
+0 forum 3

I use codeigniter3.0.0 version, when i run the project i get this error plz tell me how i fix this error. Error Number: 1048 Column 'no_of_people' cannot be null INSERT INTO reservation (no_of_people) VALUES (NULL) Filename: C:/xampp/htdocs/book/application/models/Books_model.php Line Number: 26 My model code is class Books_model extends CI_Model{ public function __construct(){ $this->load->database(); } public function get_restaurants() { $sql = "SELECT restaurant_id, names FROM restaurants "; $query = $this->db->query( $sql ); return $query->result(); } public function insert_into_db() { $people =$this->input->post('no_of_people'); return $this->db->insert('reservation', array('no_of_people'=>$people)); } } Controller <?php error_reporting(E_ALL); ini_set('display_errors', 1); class Booking_Controller extends CI_Controller{ public function __construct(){ parent::__construct(); $this->load->model('Books_model'); } public …

Member Avatar
Member Avatar
+0 forum 3

Hey , am currently doing my school project of coming up with school reports of learners but when I tried to connect my database with the ms vb it gave me an insert into error whil I was trying to register learners .Please help.

Member Avatar
Member Avatar
+0 forum 3

select * from CNPSCAR.HRZ_data where EMPLOYEENUMBER like ('%1064525','%6529623','%2264218','%1065793','%2264129','%5372488','%2062550') when executing this command i am getting error missing right parenthesis. Syntax and command looks correct can anybody help in fixing this.

Member Avatar
Member Avatar
+0 forum 1

I am using a code similar to the one below inside my stored procedure: [CODE]declare @tempVar decimal select @tempVar = amount from tempTable where <<conditions>> IF (CONDITIONAL STATEMENT) BEGIN select @tempVar END [/CODE] now I am supposed to be getting 4.25 something and I get 4, when I can clearly see in the table that this particular value is not just 4. So why is the rounding take place? Anybody know what I am missing here?

Member Avatar
Member Avatar
+0 forum 3

How to display an available room using date range? below is a code, where is display all the room on that date. its should display a room that had not been booked between two dates. my input : $datein = 31-12-2014 $dateout = 01-01-2015 below is database : ---------- room Table (example) id | name 1 | Home1 2 | Home2 3 | Home3 ---------- resinvent Table (example) resid | id | datein | dateout | status 1 | 1 | 2014-12-31 | 2015-01-01| Active below is sql code : <!-- begin snippet: js hide: false --> <!-- language: lang-html …

Member Avatar
Member Avatar
+0 forum 3

I have been cracking my head on this mater in the past couple of days. I am faced with a situaton where i need to write a MySQL equivalent of PHP code to loop through sql select results. The Php code looks like this $query = "SELECT pubid, author FROM refs"; $sql=$con->prepare($query); $sql->execute(); $sql->setFetchMode(PDO::FETCH_ASSOC); while ($row=$sql->fetch()){ $id= $row['pubid']; $author = $row['author']; $name = explode('., ', $author); } How can one write sql/mysql query that does the same?

Member Avatar
Member Avatar
+0 forum 6

I have two tables like below tb1 Date Cr Dr 2018-04-29 100 50 2018-04-30 0 150 2018-05-01 250 100 2018-05-02 150 100 2018-06-10 300 250 2018-06-11 0 50 tb2 Date Cr 2018-05-01 350 2018-05-02 250 2018-06-10 300 2018-06-11 100 2018-06-15 200 2018-06-18 100 I need the following Result Apr May Jun Cr 100 1000 1000 Dr 200 200 300 Basically I have to add the respective Cr columns from both table and get the Dr from tb1 for the corresponding dates and create a monthly report. I have tried SELECT Date(tb1.Date) as sDate, SUM(tb1.Cr+tb2.Cr) sumcr, SUM(tb1.Dr) sumdr FROM tb1,tb1 WHERE …

Member Avatar
Member Avatar
+0 forum 7

I am trying to get access toke from FB through Developer App. But I am not able to json_decode the call back response. If I use the token_url call from browser, it returns the access token. But from within the script it does work. I searched online and foun that it could be that the Json encoded response must be containg some UTF -8 BOM. So I tried some functions that would strip the response from that. However, I still am not able to get that elusive access token as a variable by json decoding and getting an array. My …

Member Avatar
+0 forum 0

Hey guys. So this should be a pretty simple question (but doesn't appear to be) that I'm hoping some of the database wizards out there can help me with. I'm not too long outta university with a BSC in Computing, I didn't get a full classification due to the fact that yup I failed the Data Management module. I was never very good with normalization and splitting a database down into the correct amount of tables and relationships. Anyway I've been asked to produce a simple web site (first paid project) for a fish and chips take away down the …

Member Avatar
Member Avatar
+0 forum 5

Greetings! I got a mysql database "backup" that someone made and I have to use it, trying to get a website back online. Its a Joomla web database. The person gave me a file "database.txt" (not database.sql) which opens with Notepad. Trying to "import" in phpmyadmin does not work and just gives out errors like " * Ending quote ' was expected. (near "" at position 4438), and " 42 values were expected, but found 21. (near "(" at position 3967)* I'm attaching 2 screeshots here so that you guys can see the contents of this file,somewhere it says mysql …

Member Avatar
Member Avatar
+0 forum 2

Need to program timeseries using RStudio in visual basic. Am trying to use time series forecastingto predict a critical newborn baby’s possible outcome in a intensive care unit so as to alert caregivers to possible detrioration.

Member Avatar
Member Avatar
+0 forum 1

Hi, How can i make query for this: Table1 Column1 Column2 LS11111 0 LS22222 100 LS33333 10 LS44444 0 LS55555 25 Table2 Column1 Column3 LS11111 100 LS22222 80 LS33333 25 Result i need is Column1 Column2 LS11111 100 LS22222 100 LS33333 25 LS44444 0 LS55555 25 Column1 is same on both tables, Column2 is pieces number in table1, and column3 is pieces number in Table2 I need maximum piece numbers. If table2 doesnt exist column1 value then shows table1 column2, and if it exist and is larger than table1 column2 then shows number from table2

Member Avatar
Member Avatar
+0 forum 3

The End.