Jump to content

Leaderboard

  1. Barand

    Barand

    Moderators


    • Points

      15

    • Content Count

      21,642


  2. requinix

    requinix

    Administrators


    • Points

      4

    • Content Count

      13,327


  3. mac_gyver

    mac_gyver

    Staff Alumni


    • Points

      4

    • Content Count

      4,548


  4. kicken

    kicken

    Gurus


    • Points

      3

    • Content Count

      3,955


Popular Content

Showing content with the highest reputation since 04/08/2021 in all areas

  1. I'll eat my words. I couldn't resist the challenge so, having slept on it, I wrote a an SQL function "isConsecutive(dates)" to find records where there are fewer than 10 dates and they are consecutive. TEST DATA and QUERY TABLE: ahtest +----+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | id | adates
    2 points
  2. how about doing the two tasks that were defined in your previous thread for this problem? producing navigation using all the rows of data and using the get input to query for the matching (one) row of data.
    1 point
  3. WHERE id = ? AND FirstImage IN (0,1)
    1 point
  4. a. any substitution or processing of output, should occur when you output the data, not when you store the data. b. if you have a need to store data containing sql special characters, quotes in this case, you would apply any escape_string() function or even better yet, simply use a prepared query, right before executing the query, not prior to content being added to the data that contains quotes.
    1 point
  5. I ran your code and it functions OK. The only way I can see that $result is not defined is if $_GET['id'] is empty or not an integer. But you say that you are inputting a valid id value so I'm out of guesses. Good luck.
    1 point
  6. the sql query you are showing and the output you are (trying) to produce from that query make no sense. if this was working, you are querying for the row of data WHERE the id column matches the $_GET['id'] value and looping to produce a (one) link with ?id=$row['id'] in it, i.e. a link containing the same id that was in $_GET['id']. you need to step back and come up with a stateable definition of what your code needs to do. you are doing two things, 1) producing navigation links, and 2) when a link has been clicked, you are displaying the content that corresponds to the id in the clicked
    1 point
  7. Do a echo "<pre>" . print_r($result, 1) . "</pre>"; die(); to see if you are getting any results.
    1 point
  8. Have you looked at the HTML source of the page? To confirm that the links really are not being outputted, as opposed to some CSS issue that's hiding them from you?
    1 point
  9. Aside from that, mysql will only report that the combination of username, password and domain was invalid, not which portions.
    1 point
  10. How to help your local neighbourhood hacker - let them know whether it was the username or the password that they got wrong. At least then they know they are half-way there.
    1 point
  11. Thanks to both of you. You have really helped me along the way with the database. Barand got me started with his ideas, and then gizmola came up with some add-ons that were in my head as add-on features to enter into the database later. It was the addition of gizmola that was missing to get this to vote. With the table berthBoat I will easily be able to add these extra features afterwards. gizmola and Barand, you are talking about something when you talk about how the system in the boating association is. It is thus the case that there is an association with permanent members where
    1 point
  12. Example <div> <img class='product-img' src='images/mac128.jpg' ></div> <div class='overlay'>Pre Order</br>NOW</div> CSS <style type='text/css'> .overlay { width: 60px; height: 60px; padding-top: 20px; border-radius: 50%; font-size: 8px; text-align: center; background-color: #E02222; color: #FFF; position: relative; top: -70px; left: 10px; z-index: 5; } </style> Result
    1 point
  13. z-index only works on positioned elements (position: absolute, position: relative, position: fixed, or position: sticky) and flex items (elements that are direct children of display:flex elements).
    1 point
  14. Oh dear. A raw image from a camera is where it records, with its electronic circuitry, the "colors" of each "pixel" that it can measure. It records that in a file in the very most basic way that "pixel X,Y is color Z" can go. Raw image files are large because there's a lot of data. To deal with the file size, images are compressed. If I write "computer computer computer" that takes 26 characters, but if you and I agree on another representation of words, I could compress the message to something like "3x computer" and 11 characters. Lossless PNG images work the same way. I could comp
    1 point
  15. Your hopes are not in vain select person_id , zones from ( select person_id , zones , find_in_set('301', zones) > 0 as has301 , find_in_set('401', zones) > 0 as has401 , find_in_set('501', zones) > 0 as has501 from ahtest ) checks WHERE has301 + has401 + has501 > 1;
    1 point
  16. Yes No. If you want to pay someone to do it for you, post in the "job Offerings" forum. Otherwise, post the code you have already and tell us where you are having probems so we can help you with your coding.
    1 point
  17. instead of that, make your data function return your games variable. return $games; Then you can assign it when you call your data function and access whatever you want. $game = new CsvToArray(); $games = $game->data(); echo $games[64]['Home Team']; Make it a function argument. function data($file){ $fileName = fopen($file,'r+'); ...
    1 point
  18. I see in your query that you are selecting several columns named "id" When you use fetch_assoc() the column names must be unique otherwise $row["id"] will be overwritten by the last one (seller id) therefore you cannot reference the user id or catgory id etc. Use column aliases to differentiate. Now you can reference $row['pid'], $row['cid'] etc When producing output with various levels of headings and subheadings and subtotals, store your data in an array that reflects the output structure. For example... $data = [ 2 => [
    1 point
  19. You are grouping by the condition category_name = 'Meat' This has two possible values (0 , 1) so you get 1 row for each value. Tubers just happens to be one of those where the condition evaluates to 0. You should GROUP BY <column name> Don't use SELECT *. Specify column names that you need. CROSS JOIN gives every combination of rows in table A joined with rows in table B so why would you want that here? For example Table A TableB ------- ------ a 1 b 2 c 3 SELECT a.col, b.col FROM tableA a CROSS JOIN tableB
    1 point
  20. Additionally, if the only thing your javascript is going to do is either redirect or show an error, then there's really no reason to use javascript / ajax at all. Just use a normal form process and keep it simple.
    1 point
  21. The data you're sending from AJAX doesn't include a 'submit' index, which loginizer.php requires to do anything.
    1 point
  22. It sounds like you might just need to re-consider your design. If it's the client that's interested in whatever this change is, the typical solution to this is to just have the client make a request periodically. One name for this is Ajax Polling. You make an Ajax request to your change detection script. The script will check for the change in a loop and return when a change is detected. You could wait 30 minutes, but it's more typical to wait 30-sec to a minute then return a "No changes" response. This way your web-server's available threads don't get used up waiting. If th
    1 point
  23. You mean are most questions we get here about Javascript? No, it's mostly PHP, but it's mostly PHP in a web context. As in PHP is running on a website and people are visiting it in their browser. Which means Javascript is an option. But sometimes there are non-web PHP questions. I don't know which one of those this thread is yet... If you want to run something every X minutes then the standard answer is to use cron: every *nix server has it, it runs in the "background", meaning it's not driven by or reliant upon users taking specific actions (such as "keeping the browser op
    1 point
  24. Sessions have expiration that you can set, as do cookies, so you have a couple different ways of handling it. I don't want to complicate things, because the way session files are cleaned up is complicated, and highly dependent on the amount of traffic a site has. Also, keep in mind that a session does not equal access. A session is just some stored data associated with a browser/client. So for example, let's say you allow access to a site via login, and you want that access to expire after 15 minutes of inactivity. One way to handle that is to have a last_request column in t
    1 point
  25. Now you have told us the actual context it makes a lot more sense than having reusable member IDs. You also introduced a couple of other attributes that would be stored in the "berth" table (renamed from member_no) viz. Size and Pier. Size required would need to be known at time of allocation to a member. Reallocation of a different berth would need to be a custom transaction, allocation on insert could be a trigger function, de-allocation could be a foreign key cascade option. Your assertion that a member is deleted when their boat changes is FUBAR. Change, or add, a record
    1 point
  26. I would created a pre-populated table "member_no" which contains a row for each of those values. create table member_no ( memno varchar(3) not null primary key, member_id int ); The "member" table would have a conventional auto_incremented numeric id (not re-used). TABLE member_no TABLE member +----------+------------+ +-----------+------------------+------ | memno | member_id | | member_id | name | etc. +----------+------------+ +-----------+------------------+----- | 01 | 1 | |
    1 point
  27. I agree with requinix, it looks like something created for security, but most of the time i see this on WP installs (does WP exist on the server e.g. shared hosting) Maybe check the logs to see what scripts/processes are running, change the permissions on the file to see if you get an error in the error logs etc. Hope this helps
    1 point
  28. Clearly you have something on the server generating this file for you. Perhaps cPanel? Is there some tool you should be using to modify this file instead of doing it yourself manually?
    1 point
  29. a phone number, despite being called a number, isn't an integer. it is a formatted string consisting of 3 or 4 fields, depending on which country you live in and if you are including the country code with international numbers. the signed integer you are using (int(12) isn't even valid) can only hold a value up to 2147483647 (214 748 3647) which can only store some US phone numbers up to area-code 214. use a string data type and format the value into a common format before using it. once you define the column with a usable data type and as a unique index, just attempt to insert the
    1 point
  30. No. Using eval is a really bad idea. There are always better solutions to problems than using eval. $num is the only unknown part, right? Look at this: $gm = array( 9 => array( "hodds" => $games[53]["BP"], "aodds" => $games[52]["BP"] ) ); echo $gm[$num]["hodds"]; Really easy.
    0 points
  31. If you have the information in your database, why do want to store it again in JSON format. Although I expect the drivers will be delighted to be handed their deleivery schedule printed in JSON format. You cannot correctly compare dates in m/d/Y format
    0 points
  32. I downloaded your code and added that attribute and it seemed to be working fine after that. You need to add it to both the CSP and the iframe's sandbox attribute.
    0 points
  33. One of those two will work and the other will not. What will happen is, if you do the correct method then it will work, and if you do the incorrect method then it will not work.
    0 points
This leaderboard is set to New York/GMT-04:00
  • Newsletter

    Want to keep up to date with all our latest news and information?
    Sign Up
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.