Skip to content

Tag: php

Pass GET Variable to Modal to use in Query

I am trying to build a budget lookup tool. I have form where someone enters an account#, fund#, and deptID#. When they hit search, it opens a modal and will display a table of the budget balances that match the entered fund, account, and deptID. I can get the modal to open but, I can’t seem to get the d…

PHP: Trying to insert dates in Database

I want to insert all the dates between a starting and an end date into a table in my database. I already found a code for the two dates and the dates between. The problem now is that the dates are not inserted into my database when running the code. Only 0000-00-00 is displayed in my date table. Also no

Follow Unfollow system

I am working on this site that follow and unfollow users just like Twitter follow. The query below works then I notice it doesn’t show me users I don’t follow because the user has been followed by somebody or is following somebody Below is my table structure In the user_follow_list Ben is followin…

PHP preg_split, split at | and check for minimum 3 chars

I want to separate at the “|” and check the length to at least 3 characters Can anybody help me? https://www.phpliveregex.com/p/AdQ Answer I think doing this in a regex might not be the best tool for the job, but if you want to use it here might be a possibility: https://regex101.com/r/Pz3YCH/1 Ag…

PHP check if value in array of objects exists more than once

I’ve this array here with multiple object: Now I need to know if there are any numbers that exists more than once. In this case its ABC. I’ve tried using array_sum and array_column but this seems to only work with numbers: Answer Use array_count_values() to count the repetitions. Then you can filt…

Php multiple data insertion with textarea

I have 500+ user:pass and i want add all data with textarea. Example ; user:pass user:pass user:pass I use the following codes to add users individually ; How can I make this to add multiple data user = username : pass = password Thanks in advance. Answer you could use explode to split your string with a sepa…

PHP WSDL response as object

I am sending a request for response to a WSDL in PHP (code below). The response is structured in a way that I’m not sure how to extract data from it. It comes back as an object with the XML inside. Is there a standard way of parsing the XML of this object? Here is my code: ?> Here is