2,113 Posted Topics

Member Avatar for Faisal_13

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?

Member Avatar for cereal
0
2K
Member Avatar for phphp

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']); …

Member Avatar for cereal
0
85
Member Avatar for Dani

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 …

Member Avatar for rproffitt
0
2K
Member Avatar for Daniel_58
Member Avatar for cereal
0
92
Member Avatar for cristi08

**@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 …

Member Avatar for cereal
0
3K
Member Avatar for John_116

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 | +-------+

Member Avatar for AssertNull
0
3K
Member Avatar for phphp

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: …

Member Avatar for cereal
0
196
Member Avatar for Joseph_24

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 …

Member Avatar for cereal
0
374
Member Avatar for davy_yg

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.

Member Avatar for cereal
0
92
Member Avatar for davy_yg

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 …

Member Avatar for cereal
0
197
Member Avatar for Goddy_1

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?

Member Avatar for cereal
0
176
Member Avatar for catastrophe2
Member Avatar for andgar56
Member Avatar for AntonyRayan

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 …

Member Avatar for cereal
0
484
Member Avatar for diafol

> 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! :)

Member Avatar for diafol
2
468
Member Avatar for showman13
Member Avatar for showman13
0
3K
Member Avatar for cereal

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: …

0
407
Member Avatar for phphp

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.

Member Avatar for cereal
0
161
Member Avatar for Stefce
Member Avatar for Stefce
0
982
Member Avatar for davy_yg

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)

Member Avatar for cereal
0
273
Member Avatar for cereal

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 …

Member Avatar for Dani
0
462
Member Avatar for Raj_17

**@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.

Member Avatar for Raj_17
0
259
Member Avatar for A_6

In addition, you can also do: echo " AS " . ($index - 10) . " - " . $index . " SA ";

Member Avatar for cereal
0
259
Member Avatar for donz365

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); …

Member Avatar for cereal
0
11K
Member Avatar for bprosic

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 …

Member Avatar for bprosic
0
356
Member Avatar for Dani
Member Avatar for cereal

Hello Dani, how can I remove my image from the Dazah.com profile? It seems it was acquired through the GMail access. Thanks!

Member Avatar for Dani
0
294
Member Avatar for phphp

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

Member Avatar for cereal
0
101
Member Avatar for gunnaparty

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!

Member Avatar for Dani
-1
283
Member Avatar for rayearth_1

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.

Member Avatar for cereal
0
518
Member Avatar for Abhi_6

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.

Member Avatar for cereal
0
311
Member Avatar for Rennie_1
Member Avatar for phphp

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

Member Avatar for hielo
0
196
Member Avatar for Amaina

After the `execute()` do: $id = $con->lastInsertId(); Docs: http://php.net/manual/en/pdo.lastinsertid.php

Member Avatar for Amaina
0
282
Member Avatar for Amaina

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

Member Avatar for Amaina
0
758
Member Avatar for Stefce

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` …

Member Avatar for cereal
0
158
Member Avatar for Aeonix

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

Member Avatar for cereal
0
4K
Member Avatar for tqmd1
Re: Int

> 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

Member Avatar for cereal
0
116
Member Avatar for Aeonix

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!

Member Avatar for cereal
0
253
Member Avatar for SpottyBlue
Member Avatar for Aeonix

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`.

Member Avatar for Aeonix
0
167
Member Avatar for abhi10kumar

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, …

Member Avatar for cereal
0
324
Member Avatar for Mr.M

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.

Member Avatar for Mr.M
0
251
Member Avatar for 1stDAN

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. …

Member Avatar for Reverend Jim
0
194
Member Avatar for Aeonix

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

Member Avatar for diafol
0
239
Member Avatar for sukumar paul

Hi, I would probably start from this link: * http://www.oracle.com/technetwork/database/features/plsql/index.html

Member Avatar for sukumar paul
0
186
Member Avatar for Aeonix

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

Member Avatar for cereal
0
161
Member Avatar for AntonyRayan
Member Avatar for Amaina

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]: …

Member Avatar for diafol
0
2K
Member Avatar for tapuwa2002

**@Awais_2** hello, please: follow the community rules, open a new thread and share the code that is giving you the issue.

Member Avatar for cereal
0
3K

The End.