[Solved] PHP doesn’t get HTML Form values

You are missing ;’s at the end of your lines. <?php $conn = mysql_connect(localhost, root, usbw); mysql_select_db (‘veiling’); $bid = $_GET[‘bod’]; $name = $_GET[‘naam’]; $item = $_GET[‘item’]; $maxbid = mysql_query(“SELECT MAX(bod) FROM veiling WHERE item=1”); $maxbid = mysql_fetch_array($maxbid); if( $bid =< $maxbid[0] ) { die(); } else { mysql_query(“INSERT INTO veiling (bod, naam, item) VALUES … Read more

[Solved] How to filter twice using subquery? [closed]

I think you just need this. There is no need for the subquery. SELECT DISTINCT T0.project_number_ext as ProjectNumber ,T0.status_desc as SDesc ,T0.Project_name as PName From trimergo.rpt_getProjectPOC T0 WHERE T0.sproject_number IS NULL AND ( T1.SDesc LIKE ’10 – In Proposal%’ OR T1.SDesc like ’90-Lost Opportunity%’ ) 3 solved How to filter twice using subquery? [closed]

[Solved] Does this SQL statement look right?

You want to display distinct values of Department Number and Department Name You join Employees table with Department on Department Number You join Jobs table with Employees on Job ID You filter the result by excluding those Department Numbers of the entire Employee table that have a Job ID matching the pattern %SA_REP% In my … Read more

[Solved] SQL Server Loop and Cursors [closed]

SET NOCOUNT ON will prevent a message being returned saying how many rows were updated. In some situations in code this is necessary because the message is interpreted as an additional resultset. There is also some additional overhead with this message. CURSORS are used to perform operations in a procedural fashion instead of the usual … Read more

[Solved] SQL request with JOIN and COUNT

If I am reading your question right, the result table give you the age ID and Period, and then the count of toys per age ID and Period. Here is how you would write that query: SELECT Ages.ID, Ages.Period, IFNULL(sub.cnt,0) AS Count FROM Ages LEFT JOIN (SELECT Toys.age_id, COUNT(*) AS cnt FROM Toys GROUP BY … Read more

[Solved] Can I display all users using php and sql?

mysqli query need connection parameter at first. More about mysqli query. Try this $query = mysqli_query($connection_var, “SELECT username FROM member”); echo ‘<table>’; while($rowtwo = mysqli_fetch_array($query)){ echo ‘<tr><td>’.$rowtwo[“username”].'</td></tr>’; } echo ‘</table>’; 0 solved Can I display all users using php and sql?

[Solved] Using a Case Statement With IS NULL and IS NOT NULL

You are misusing the case expression. There are two forms. The form you want is: (CASE WHEN userName IS NULL THEN ‘was null’ WHEN userName IS NOT NULL THEN ‘was not null’ END) AS caseExpressionTest Note: There is no userName after the CASE. This checks each condition stopping at the first. MySQL interprets booleans as … Read more

[Solved] Database schema with categories, subcategories and products [closed]

I would recommend structuring your category table like below: Category ———- CategoryId ParentCategoryId –nullable CategoryName I’m not sure what you want to store in products so it’s hard for me to tell you how to design that, but at a minimum you should have a CategoryId column in there. I would leave it to your … Read more

[Solved] Custom row number in SQL

If you have a column in that table, that defines an order, you could get the section numbers with subqueries fetching the count of rows with lower ordered rows with the respective level. Assuming the column defining the order is id something looking like this could be what you want. SELECT col1, convert(varchar(max), (SELECT count(*) … Read more

[Solved] display value of database [closed]

Try something like this: Global.dbCon.Open(); List<int> idQuestions = new List<int>(); kalimatSql = kalimatSql; Global.reader = Global.riyeder(kalimatSql); if (Global.reader.HasRows) { while (Global.reader.Read()) { int idQuestion = Convert.ToInt32(Global.reader.GetValue(0)); idQuestions.Add(idQuestion); } } Global.dbCon.Close(); foreach (int id in idQuestions) { messageBox.Show(id.ToString()); } What we are doing here is adding all of the question ids into a list and then … Read more

[Solved] mysql , max ,groub by [closed]

suggest that if your above SQL statement can query the result. maybe you can just skip the “order by” and simply just select * from (/* your SQL statement without “order by”*/) a order by a.message_id desc sorry that as it is difficult to see your screen capture and help you to resolve the SQL … Read more