2,113 Posted Topics
Re: Hi, so you want to group the names under each town? For example: <ul> <li>Town <ul> <li>Name X</li> <li>Name Y</li> <li>Name Z</li> </ul> </li> ... </ul> is this correct? | |
Re: Hi, look I will not fix that query as it would be wrong in any case. Use prepared statements. Example with PDO: $query = "INSERT INTO `history` (`user`, `login`, `logout`, `duration`, `user_ip`, `user_lo`) VALUES (:user, :date, :date, 1, :ip, 'myplace')"; Then use `bindParam()`: $stmt = $conn->prepare($query); $stmt->bindParam(':user', $muser); $stmt->bindParam(':ip', $_SERVER['REMOTE_ADDR']); … | |
Re: Hi Dani! You can see the response header and the request flow by adding: curl_setopt($ch, CURLOPT_HEADER, TRUE); curl_setopt($ch, CURLOPT_VERBOSE, TRUE); > I'm passying in Connection: keep-alive headers but they are not showing up in the $_SERVER dump. It probably happens because you're submitting the headers as an indexed array, instead … | |
Re: Hi, have you tried PI MusicBox? http://www.pimusicbox.com/ | |
Re: **@harsh_7** Hi, I'm not sure what the OP was trying to do but, in reference to result sets from databases, look at methods like `bindColumn()`: * http://php.net/manual/en/pdostatement.bindcolumn.php the variable is initialized and tied to a column name, and will default to NULL if the result set is empty. Counting could … | |
Re: As alternative, if the dates are saved into a database table, you could use `datediff()` along with `date_add()` (to get the [inclusive counting](https://en.wikipedia.org/wiki/Counting#Inclusive_counting)) and `sum()`, for example: select sum(datediff(date_add(`to`, interval 1 day), `from`)) as `total` from `holidays` where `employee_id` = 1; +-------+ | total | +-------+ | 21 | +-------+ | |
Re: You can do: SET @dt = '2016-07-18'; SELECT * FROM `arrival` WHERE `created_at` >= DATE_FORMAT(@dt ,'%Y-%m-01') AND `created_at` < @dt; the `DATE_FORMAT()` will output the first day of the month `2016-07-01`, since you don't want to include the last day you cannot use the `BETWEEN ... AND` statement. More info: … | |
Re: Hi, if the connections are limited (20 concurrent users) then Access can work fine, by opening more connections the database performance can degrade fast. How do you plan to update the database: through script; Access interface? Have you considered MySQL or PostgreSQL? Both are open source, multiplatform and free for … | |
Re: You can start from yellow pages or get a list at the local chamber of commerce. Start from typography services, if they like the work you do for them, there are chances that will call you to serve their clients too. | |
Re: Hi, do you want to build it from scratch or you want to install a monitoring software? In the first case you can parse the access logs of the server and use javascript to catch events on the page. Read the documentation of the web server in use to see … | |
Re: Hi! Your thread is marked solved, did you actually solved the issue? Do you care to share your solutions for the readers? Last question: are these `1/07/59 - 2/07/59` Thai calendar dates? | |
Re: Hi, is the curl request link correct? By testing I get a 404 page, not JSON data. | |
Re: Hi, which server side language and database are you going to use? | |
Re: Hi, * is the second database in the same server of the first database? * if affirmative: do you access with same credentials? * if affirmative: do you have same permissions? If it is all affirmative then you can access the second database from the same connection to the first … | |
![]() | Re: > If using Chrome as your browser, you can install Tampermonkey as a plugin extension. It works also with the [CJS (Custom JavaScript extension).](https://chrome.google.com/webstore/detail/custom-javascript-for-web/poakhlngfciodnhlhhgnaaelnpjljija?hl=en) Thank you for sharing, it's great! :) ![]() |
Re: By the way, have you tried through their API? https://codepen.io/bfred-it/pen/GgOvLM | |
Hello everybody, so, I realized that when I try to load some XML into a MySQL table through the `LOAD XML LOCAL INFILE ...` statement, if there is a parent with the same name of the child, MySQL will insert an extra row. Here's the example to reproduce the issue: … | |
Re: Hello, if haven't solved yet, show us the schema of the history table, run: SHOW CREATE TABLE `history`; Consider that the insert cannot occour if there is a unique key on the user. | |
Re: **Date** is a reserved word, use backticks for the column and table names. | |
Re: Maybe [this thread?](https://www.daniweb.com/programming/web-development/threads/503302/xampp-for-win-7-64-bit) To check your previous threads go to your profile and click on [**Discussion Threads**.](https://www.daniweb.com/members/903876/davy-yg/threads) | |
Hello, I was trying to send a PM but it seems to hang: after clicking the submit button this disappears and it does not happen anything else. With short messages it seems to work fine, but it appears slow. When I try to submit a message with ~9k characters, I … | |
Re: **@Raj_17** Hi, I suppose you were referring to [this thread](https://www.daniweb.com/programming/web-development/threads/480731/how-to-inserting-files-on-mysql-using-laravel) but it seems you already got a reply here: * http://stackoverflow.com/questions/38221239/cli-stopped-working-error Follow **sunny kashyap** suggestion and use `Illuminate\Http\Request`, check the documentation https://laravel.com/docs/5.2/requests#files Bye. | |
Re: In addition, you can also do: echo " AS " . ($index - 10) . " - " . $index . " SA "; | |
Re: Hi! Apparently you get NULL, but PHP is also sending a warning: Warning: simplexml_load_string() expects parameter 1 to be string, object given because `$values->getCourseDetailResult` is an object, and outputs: stdClass Object ( [any] => XML is here ... ) So change your previous: $xml = simplexml_load_string($values->getCourseDetailResult); To: $xml = simplexml_load_string($values->getCourseDetailResult->any); … | |
Re: Hi, `array_diff()` will return the index key, so you can get the corresponding values for each array, as example: <?php $a = [4711, 4712, 4713, 4714]; $b = ['ALFA ROMEO', 'BMW', 'SKODA', 'TOYOTA']; $c = [6.5, 65, 0.2, 2.9]; $d = [4711, 4712, 2856, 4714]; $diff = array_diff($a, $d); $key … | |
Hello Dani, how can I remove my image from the Dazah.com profile? It seems it was acquired through the GMail access. Thanks! | |
Re: Hi, if you're trying to run the script outside the 000webhost.com hosting and you don't have a premium account, then the connection will fail, read: * https://www.000webhost.com/website-faq/how-can-i-connect-to-mysql-from-my-computer-27 | |
![]() | Re: Hi, go to the dropdown menu with your username, click on **Edit My Profile**, scroll the page down, until you get the **Permanently Delete Membership** button, click it. Bye bye! |
Re: Hi, you still need a client side script to submit the on going request, you can do that without a framework, look for an example at the autocomplete.js code: * https://autocomplete-js.com/ it does not have dependencies. | |
Re: Hi, check if the new value was applied by using [`ini_get()`:](http://php.net/ini-get) echo ini_get('memory_limit'); some hostings does not allow to change the core directives. | |
Re: Before that line check if the $_FILES array exists: if the form is submitted without appending a file, or if the upload fails (file too big, for example), then you will get that error. Also, you can use `pathinfo()` to get the extension: $ext = pathinfo($_FILES['file']['name'])['extension']; Docs: http://php.net/manual/en/function.pathinfo.php | |
Re: After the `execute()` do: $id = $con->lastInsertId(); Docs: http://php.net/manual/en/pdo.lastinsertid.php | |
Re: Hi, use the search box in the developers website: * https://developer.wordpress.org/reference/ From there you can see how the add and update metadata functions are used and in which files are written. See also: * https://codex.wordpress.org/Metadata_API | |
Re: Hi, you can get a list in JSON format here: * http://openexchangerates.org/currencies.json you can get a free API key for 1000 request per month and get currency rates hourly updated: * https://openexchangerates.org/ And build your own system, but you should consider using a library, like MoneyPHP: * https://github.com/moneyphp/money The `doc` … | |
Re: Hi, `topics.id` stands for `tableName.columnName`, if this is not the case and you have a column name with a dot, then do: SELECT `topics.id` FROM `topics`; This will select the column with the dot. If it was a table name, instead it would be: SELECT `topics`.`id` FROM `topics`; Ref: http://dev.mysql.com/doc/refman/5.7/en/identifiers.html | |
Re: > A string is not an integer. in PHP, from the POST and GET arrays, you always get strings, even if submitting integers. PHP does automatic type casting, but it can be forced as explained here: * http://php.net/manual/en/language.types.type-juggling.php | |
Re: Set `exit;` after the redirect, as in this comment: * http://php.net/manual/en/function.exit.php#90713 That will stop the execution of the following code. Bye! | |
Re: Could you paste the code here? | |
Re: Hi, I use this tool: http://www.generatedata.com/ The online version is limited to 100 entries, but it can be downloaded for free from github and loaded in local PHP server, just do `php -S localhost:8000`. | |
Re: Hi, just add delimiters to the pattern variable, in your case it's `$word`, for example: <?php $color = 'red'; $text = 'This is an example text sentence.'; $eregPattern = 'example'; $pregPattern = '/example/'; $replacement = '<font style="background:' . $color . ';">\0</font>'; echo eregi_replace($eregPattern, $replacement, $text); print PHP_EOL; echo preg_replace($pregPattern, $replacement, … | |
Re: What happens if they choose the same password? Usernames should be unique, if you cannot then make something else unique, like email addresses and force the sign in through the unique column. By fixing this, you solve the issue. | |
![]() | Re: Hi, once you have selected a main category, just add one or more tags, as you did with `forums`, for the database flavour you wish to write about. That helps people to filter what they want to read, but the thread will still be visible in the main category, i.e. … |
Re: Hi, `s` stands for string, if you want two conditions, for example a string and a digit you will write: $city = 'Aurora'; $state_id = 1; bind_param("si", $city, $state_id) Read the documentation to see the data types you can define: * http://php.net/manual/en/mysqli-stmt.bind-param.php ![]() | |
Re: Hi, I would probably start from this link: * http://www.oracle.com/technetwork/database/features/plsql/index.html | |
Re: Hi, don't use single or double quotes around table and column names, otherwise these are interpreted as strings, use backticks, so: INSERT INTO `members` (`username`, `password`, `email`) VALUES ('axe', 'axe', 'weql'); * http://dev.mysql.com/doc/refman/5.7/en/identifiers.html | |
Re: Hi, can you show us the insert script? | |
Re: Hi, at the moment you're using the `$username` variable directly inside the query and without quotes: where username = $username change it to the placeholder: where username = :username as is set by the `bindValue()` method. Also, if not used, remove the `:roleid` bindValue() as that will produce: > 'SQLSTATE[HY093]: … ![]() | |
Re: **@Awais_2** hello, please: follow the community rules, open a new thread and share the code that is giving you the issue. |
The End.