Skip to content
  • 0 Votes
    6 Posts
    0 Views
    S
    A super global variable called $_SERVER["PHP SELF"] returns the name of the script that is presently running. As a result, rather than navigating to another page, the $_SERVER["PHP SELF"] transmits the form data to the current page. The user will receive error notifications in this manner on the same page as the form. On page load, you can leave the table's property set to display:none, and when the button is clicked, run a function to change the table's display to block.
  • 0 Votes
    5 Posts
    0 Views
    N
    :thumbsup::thumbsup: M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you Rating helpful answers is nice, but saying thanks can be even nicer.
  • 0 Votes
    6 Posts
    0 Views
    D
    Yes, that's it, but now I must find a way to solve my problem thank you for the tip oh, thats a very good side to learn for all beginners like me https://www.dotnetperls.com/parse
  • 0 Votes
    3 Posts
    0 Views
    C
    As you have not shared your attempt at solving this for yourself, nor responded to Craig, I am only going to give you hints to a possible solution. For my test data I used this declare @demo table (startdate date, enddate date) insert into @demo (startdate, enddate) values ('2022-03-01', '2022-04-10'), ('2021-12-01', '2022-03-11'), ('2022-01-01', '2022-04-05'); I also hard-coded the start and end dates for the month I am interested in declare @1stDay date = '2022-04-01'; declare @LastDay date = '2022-04-30'; I then wrote some sql that would convert the dates I had on the table to only those that fell into the month I am looking at. E.g. Something like this select startdate, enddate ,case when startdate < @1stDay then @1stDay when startdate > @lastDay then @LastDay else startdate end as AmendedStartDate ,case when enddate < @1stDay then @1stDay when enddate > @LastDay then @LastDay else enddate end as AmendedEndDate from @demo; I then used those Amended dates in a datediff calculation to get the number of days in each range that fell in April 2022. This approach is flawed - in that I get 9, 0 and 4 as the results instead of 10, 0, 5. I will leave that as an exercise for you to sort out. I also coded this in MSSQL so you may need to make minor syntactical changes
  • 0 Votes
    3 Posts
    0 Views
    N
    v1 - CodeProject[^] M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you Rating helpful answers is nice, but saying thanks can be even nicer.
  • 0 Votes
    3 Posts
    0 Views
    C
    Firstly - take note of the previous comment about SQL Injection! Quote: I want the array `$user_tree` to hold (user_id 5) first, then (user_id 6), how to do that? Then you need to order your results by [user_id] e.g. select * from @demo where upline = 2 order by [User_id]; Quote: I want to print **Left_id** first, then only print **Right_id**. May I know how to do it? I'm not entirely sure what you mean here, but it sounds like you want the columns in a different order in your result. In the example above I used select * - that is not actually good practice. It is much better to list the columns that you want, in the order that you want them - this helps protect any code that is using the results from any subsequent changes to the table schema, such as adding a new column. However, if you mean you want to sort by one column within the "grouping" of another column then you simply add a list of things to sort by. This example covers both the scenarios above select Left_id,Right_id from @demo order by Upline, [User_id]; If you meant something else then reply to this solution and I will try to help
  • Inserting Through Radionbutton and checkbox

    C# database mysql com sales question
    7
    0 Votes
    7 Posts
    0 Views
    C
    You will need to research how to do an "exclusive or" to learn the syntax. As for my SQL comment - it still applies to MySQL. You must learn how to tell if the SQL command ran successfully. You cannot assume that it ran as desired just because control flows to the next statement. This is why others are telling you to check for sucess on your SQL operation before you proceed to the statement that says it succeeded. When you become a professional programmer, you need to worry about things like "Do I have authority to access the database? Is the database online? Did some other unexpected condition occur?" Much of programming is dealing with gracefully handling errors and unexpected conditions. CodeProject members are professionals and their tips and suggestions are to help you achieve that skill level.
  • Password CAPS not Checking in my code

    C# database mysql tutorial question
    7
    0 Votes
    7 Posts
    0 Views
    D
    All this time and you still don't get it. You've already been given all the links to read to figure this out. You just refuse to do the work yourself. Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles. Dave Kreskowiak
  • Error on Coding

    C# database mysql help
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Mysql Query Error

    C# database mysql help question
    3
    0 Votes
    3 Posts
    0 Views
    OriginalGriffO
    To add to what David has said, you are also putting yourself at quite considerable risk: Never store passwords in clear text - it is a major security risk. There is some information on how to do it here: Password Storage: How to do it.[^] And remember: if this is web based and you have any European Union users then GDPR applies and that means you need to handle passwords as sensitive data and store them in a safe and secure manner. Text is neither of those and the fines can be .... um ... outstanding. In December 2018 a German company received a relatively low fine of €20,000 for just that. The more I see of "your code" the more I think you aren't anywhere near ready for whatever it is you are trying to do ... "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!
  • C# to Mysql Login code Error

    C# csharp database mysql help question
    39
    0 Votes
    39 Posts
    0 Views
    D
    How many times do you have to be told "nobody is going to do your work for you" before it sinks in? Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles. Dave Kreskowiak
  • Need C# and Mysql Tutorial

    C# csharp asp-net database mysql
    3
    0 Votes
    3 Posts
    0 Views
    R
    You could try Microsoft's own site for C# - .NET on Microsoft Learn | Microsoft Docs[^]
  • Mysql Update Query Error

    C# database mysql help question announcement
    16
    0 Votes
    16 Posts
    0 Views
    OriginalGriffO
    I say we take off and nuke the entire site from orbit. It's the only way to be sure.[^] "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!
  • Need confirmation before deleting the record

    C# question database mysql help career
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • mysql delete code error

    C# database mysql help career
    21
    0 Votes
    21 Posts
    0 Views
    D
    You're not listening, and i'm not even entirely sure you even read entire replies to you. YOu're just looking for copy'n'paste code without any work on your part, that's where the problem lies. Where did those "AND" clauses come from? They're not in the SQL statement I wrote, and they are not needed at all since an ID uniquely identifies records. Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles. Dave Kreskowiak
  • Connection string Error VS to Mysql

    C# database sysadmin csharp mysql sql-server
    15
    0 Votes
    15 Posts
    0 Views
    L
    I am not @OriginalGriff.
  • 0 Votes
    4 Posts
    0 Views
    R
    I've set my own computer up with Apache/PHP/MySQL several times, and it has always required some manual configuring before everything was just right. I did that to learn, but there are several WAMP packages that install with everything configured automatically. If you don't know, WAMP is Apache, MySQL, and PHP in a package for Windows, thus WAMP. Consider getting one of those packages and including it separately with your demo, and just instruct the clients to first install the WAMP and then install your demo. As you move forward, consider adding more flexibility to your application so it doesn't have to have specifically a local MySQL database. Even if you stay with MySQL, the database should be able to be located anywhere, and all that needs to change is the connection string. Good luck! :)
  • 0 Votes
    3 Posts
    0 Views
    M
    One of various ways to do this: Use a dynamically created web page for the page that you do not want to be directy accessed. When page one is accessed, properly, and with your predetermined permission; then page two is made available via a javascript that directs them to page two with it's dynamically created name. Example: Page 1 = daPage01.html Page 2 = [does not exist except in the database] User goes to Page 2 : Oh wait! There is no Page 2. That page is still in the database. User goes to Page 1. There is no link to Page 2. User does what YOU want them to do on Page 1. Page 2 is created dynamically with a changable name. Exmaple: daPage12E13F4576496587G5447868764K5P7q84578_02.html Page 2 is then added to Page 1 for that user to click on and to go to. Later that user goes to Page 2 via that link. Oh wait! When they were detected of having closed or left Page 1 and *also* closed or left Page 2 then Page 2 was removed from the system. There is no Page 2 for them.
  • [MySQL] Failed to set datadir

    Database help html mysql com sysadmin
    11
    0 Votes
    11 Posts
    0 Views
    L
    The message lists all the values it is trying to use to connect. So it is reasonably safe to assume that one or more of them is not correct. That is the only information you have to work with, so you need to investigate further to discover which one it is.
  • no response on submitted article

    Article Writing database php mysql com tutorial
    2
    0 Votes
    2 Posts
    0 Views
    S
    Thanks very much for the message. It seems your email was misplaced, we have located the article and will post for you today. Apologies for the delay. Thanks, Sean Ewington CodeProject