-
Posts
24,609 -
Joined
-
Last visited
-
Days Won
831
Everything posted by Barand
-
Instead of outputting the the HTML for a table with rows, you output the HTML for the cards instead.
-
-
-
Don't know if this is connected but recently I have been working with another Invision-powered site. When connected to either taht site or Freaks site (even if the tab is not current tab) my broadband upload speed is crippled, sometimes dropping below 1Mbps. Both these sites repeatedly have the same effect and I have not seen it happen on any other sites. Prior to connection Connected to https://www.foxestalk.co.uk or Freaks On closing the Invision tab the speed returns to normal. It seems the Invision software permanently hogs the line.
-
This is your query in a more readable form select DISTINCT , login.username , login.login_time , players.Player_ID , players.Player_name , players.Player_First_Name , Players.Player_Last_Name , players.player_email INNER JOIN players on login.username=players.Player_ID where login.login_time > ‘2019-09-09’ It is missing "FROM login" where I left the empty line before "INNER JOIN". Your date needs to be inside plain single quotes (not the single inverted quotes that your editor has used). Are you sure you want to be joining a username with an id (usually numeric)? If none of those help, show us the error message your are getting.
-
.. or JSON as an alternative was also proposed. Both are suitable for products with different attribute sets. Possibly - that's usual bandaid to resort to when you've spread data over several tables instead of one. Try it and see. Experimentation is a wonderful technique.
-
The point is, they are crap bad variable names if you want anyone else to understand how to relate your code to the problem you so poorly described. If you are storing the data as a comma separated lists, you need to normalize your data. Good luck;
-
Your fist post talked about users, goals and tasks. Your second is all about visits and routes. Have you moved on to another problem somewhere inbetween and haven't told us?
-
Perhaps this answer I gave you a year ago might help
-
To see if you have any mysql errors, put this line immediately before the line calling mysql_connect() mysqli_report(MYSQLI_REPORT_ERROR|MYSQLI_REPORT_STRICT); EDIT: and where is $myout defined?
-
I have re-structured your code for you, adding a list of contacts so you can see if they are added. <?php $servername = "localhost"; $username = "admin"; $password = "1234"; $dbname = "test"; $conn = new PDO("mysql:host=$servername;dbname=$dbname;charset=utf8", $username, $password); $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $conn->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC); $conn->setAttribute(PDO::ATTR_EMULATE_PREPARES, false); ## ## Has data been posted? ## if ($_SERVER['REQUEST_METHOD'] == 'POST') { if (trim($_POST['name']) != '') { // use prepared statement $stmt = $conn->prepare("INSERT INTO contacts (name) VALUES (?)"); $stmt->execute( [ $_POST['name'] ] ); } // reload page header("Location: #"); exit; } ## ## Create contacts check list ## $res = $conn->query("select id , name from contacts order by id "); $list = ''; foreach ($res as $row) { $list .= "<tr><td>" . join ('</td><td>', $row) . "</td></tr>\n"; } ?> <!DOCTYPE html> <html lang="en" dir="ltr"> <head> <meta charset="utf-8"> <!-- Bootstrap core CSS --> <link href="css/bootstrap.min.css" rel="stylesheet"> <link rel="stylesheet" type"text/css" href="css/style.css"> <script src="http://cdn.ckeditor.com/4.6.1/standard/ckeditor.js"></script> </head> <body> <div class="modal fade" id="addContact" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> <form method="post"> <!-- .....content with all the inputs --> <input type="text" name = "name" value="" class="form-control" placeholder="Name of contact..."> <button type="submit" class="btn btn-primary">Save to database</button> </form> </div> <hr> <h3>Contacts Check List</h3> <table style='width: 400px;'> <tr><td>ID</td><td>Name</td></tr> <?=$list?> </table> </body> </html>
-
https://lmgtfy.com/?q=html+meta+refresh
-
A meta-refresh will do what you want <?php echo "Your pizza is ready<br>"; echo "<meta http-equiv=\"refresh\" content=\"5; url='url-to-go-to'\" />" ?>
-
Don't hijack other people's topics Try Google
-
pass date variable to SQL Server pivot query correctly
Barand replied to kat35601's topic in Microsoft SQL - MSSQL
One problem you have is that you cannot correctly compare date values in m/d/Y format. To compare reliably they need to be Y-m-d. 08/01/2020 > 02/01/2021 whereas 2021-01-02 > 2020-01-08 - correct -
Cannot call Session Variable to regular variable for SQL lookup
Barand replied to bakertaylor28's topic in PHP Coding Help
RTFM https://www.php.net/manual/en/language.operators.assignment.php https://www.php.net/manual/en/language.operators.comparison.php- 12 replies
-
Why have you got three tables with the same apparent structure instead of a single table with an extra column to indicate paye/contract/permanent?
-
If it did it was only by luck. The information returned for each id could come from any of the records with that id, not necessarily the one with the max value.
-
You need to match aginst the subquery on id and time. Table subqueries require an alias (as virtual table name) try SELECT pda.* FROM production_data_archive pda INNER JOIN ( SELECT order_id MAX(insert_time) as insert_time FROM production_status_archive GROUP BY order_id ) pda2 USING (order_id, inser_time)
-
You have this situation if (....) { // define row row = something } echo row; // here you attempt to use row whether it was defined or not
-
Also, your data table design is wrong. Don't store data (particularly IDs) in comma separated lists.
-
Yes, you are - the answer was given to you ... The answer to the above question, BTW, is NO.
-
1) do not double post. 2) we don't like being shouted at.
-
https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/required