[Solved] I am getting error while loading linktext.com from SQL with help of PHP [closed]

I would have a guess that you need escape the quotes or use single quotes in your SQL. I would have a stab and say your code is outputting an incorrect format for the links. $url=”<a href=”https://stackoverflow.com/questions/46113161/link.com”>link.com</a>”; ## << This is the value from the database echo $url; As you can see there are too … Read more

[Solved] SQL – Select all row that exist between two dates [closed]

I think this should work. I used :start and :end as placeholders for your input values. The query selects all employees with their working dates when the working date is at least partially part of your input range. Visualization (I: input range, y: selected, n: not selected): ——–IIIIIIIIIIIIIIIIIIII———- –nnn-yyyy—yyyy———yyyyy—-nn- Query: SELECT * FROM workdates WHERE … Read more

[Solved] SQL Print the name of all Employees together with the name of their supervisor

An inner join should do it. Here’s the syntax, but you’ll have to apply it to your database: SELECT c.name, o.name FROM cats c INNER JOIN owners o ON c.owner_id = o.id “cats c” basically means “Cats table, which I’m nicknaming c.” “owners o” basically means “Owners table, which I’m nicknaming o.” In your select, … Read more

[Solved] First echo database row doesn’t show PHP [duplicate]

Replace the for loop with this: while($row=mysqli_fetch_array($result)){ echo “<td><strong>From:</strong>”.$row[“fra”].” <br><strong>To:</strong> “.$row[“til”].” <br><strong>Date:</strong> “.$row[“dato”].” <br><strong>Clock: </strong> “.$row[“klokkeslett”].”</td>”; echo “<td></td>”; echo “<td></td>”; } You are telling you program to keep looping through mysql_fetch_array($result) and assign the fetched record to $row. Also, do not forget to take out this line $countRows=mysqli_affected_rows($db); as you no longer need it. 1 … Read more

[Solved] Incorrect syntax near ‘,’ [closed]

What is this little snippet: … p7,ex8,p8,,p3,p4,p5 … ^^ meant to be? That’s a rhetorical question by the way, since at least one commenter didn’t understand that 🙂 That’s where your trouble lies. In fact, since you have 24 column names (excluding the empty one between the commas) and only 18 values to be inserted … Read more

[Solved] Stock keeping System [closed]

You would need at the very least two tables. One for storing stores and other for products. One table for each store makes little sense to me. 2 solved Stock keeping System [closed]

[Solved] VALUE NOT EXIST (SQL)

You can use exceptions. Try this: DECLARE y NUMBER; b emp.ename%TYPE; BEGIN y := :enter_no; SELECT ename INTO b FROM emp WHERE empno = y; EXCEPTION WHEN NO_DATA_FOUND THEN DBMS_OUTPUT.PUT_LINE(b); END; 0 solved VALUE NOT EXIST (SQL)

[Solved] Extract month and day from a field in sql

If your filed is a Date or DateTime, I would use the function DATEPART. For example, this gets the current year: DATEPART(year, GETDATE()) View the msdn page for the full documentation. If your field is text, use CONVERT to convert your field to a DATE, then use the first method with the converted date as … Read more

[Solved] SQL: query contains at least one “true” value

You should show some effort and try to solve it yourself (it’s good for learning if for no other reason), but anyway, this can be done in several ways. This is two: SELECT idt, nome, bool1 FROM path WHERE idt IN ( SELECT idt FROM path WHERE bool1 = ‘true’); SELECT path.idt, nome, bool1 FROM … Read more

[Solved] SQL query to retrive data [closed]

Better version in a single query: select p1.productname from Product p1, myorder s1, lineitem l1, customer c1 where l1.pid=p1.pid and l1.OID=s1.oid and c1.cid=s1.cid and c1.city=’mycity’ group by p1.ProductName having count(distinct c1.cid)=(select count(1) from customer c2 where c2.city=’mycity’); solved SQL query to retrive data [closed]