2,113 Posted Topics

Member Avatar for gamebits

By the way: you can use `$deck = range(1, 52);` to get the numbers array, each entry will be an integer.

Member Avatar for cereal
0
442
Member Avatar for AntonyRayan

Hi, CodeIgniter 2.* is in legacy mode and reached end-of-life on October 31, 2015. It means they are not going to support it anymore. It's there for projects already developed under this code, but you should not use it to start new ones, as if a security issue is found, …

Member Avatar for Nishant shukla1
0
4K
Member Avatar for ddanbe
Member Avatar for lewashby

Can you show your form code? Anyway you can setup a simple echo script (echo.php) and see what really happens when a request is sent. You need to open two terminal windows. Start with this script: <?php if($_POST) echo 'POST:' . PHP_EOL . print_r($_POST, TRUE); if($_GET) echo 'GET:' . PHP_EOL …

Member Avatar for cereal
0
369
Member Avatar for shany0786

**@shany** Hi, consider that MySQL **will not** return the last inserted id if: * the table does not have a column with the `auto_increment` attribute * or if you manually feed the id Example: -- table without auto_increment column CREATE TABLE IF NOT EXISTS `test` ( `tid` INT UNSIGNED NOT …

Member Avatar for cereal
0
2K
Member Avatar for brispea

Hi, check the **Hoa Project**: * http://hoa-project.net/En/ In particular: * https://github.com/hoaproject/File You can embed this code by using composer, which is supported by the latest version of CodeIgniter.

Member Avatar for cereal
0
3K
Member Avatar for AntonyRayan

You have to format the date string to something that `Date()` can handle, follow: * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse

Member Avatar for cereal
0
118
Member Avatar for jkon

Memcached is not available, it is in Ondřej ppa, but still not official: * https://launchpad.net/~ondrej/+archive/ubuntu/php-7.0

Member Avatar for diafol
0
211
Member Avatar for UK-1991

Just give arguments to the `ads()` controller, for example: public function ads($cat, $add_name) { $data['cat'] = $cat; $data['add_name'] = $add_name; $this->load->view('ads', $data); } In this case the url would look like: http://localhost/directoryname/listings/ads/categoryname/name Otherwise use `$this->input->get()`: public function ads() { $data['cat'] = $this->input->get('cat'); $data['add_name'] = $this->input->get('add_name'); $this->load->view('ads', $data); } For more …

Member Avatar for cereal
0
1K
Member Avatar for Stefce

Hi, small addition: look at **R** language, which is used to find patterns into data structures: * https://www.r-project.org/ To know how this is applied search for **machine learning** topics. Some publications about this can be found at Facebook's research website: * https://research.facebook.com/publications/machinelearning/ * https://research.facebook.com/publications/ai/ Recently an Open AI project started, …

Member Avatar for rproffitt
0
412
Member Avatar for jaime.bentez

Hi, best solution would be to get data through **mysqldump** and then push the backup into the server. By the way, if there were InnoDB tables then you also need ibdata files otherwise moving the files will not work. Also if there were user defined functions and stored procedures you …

Member Avatar for jaime.bentez
1
1K
Member Avatar for Shabbir_1

No, from SQL injection you're safe with prepared statements, but you are exposed to an XSS attack, here: echo "<div class='alert alert-success' role='alert'>Well done! You successfully created user: <b>".$_POST['username']."</b></div>"; echo "<div class='alert alert-danger' role='alert'>Oh snap! Failed to create new user: <b>$_POST[username]</b></div>"; `$_POST` is not sanitized, so I could inject javascript …

Member Avatar for diafol
0
197
Member Avatar for Dani

> In the previous century (the owls could still speak sometimes :o) ) we used to keep some sort of diary where we noted every day on which part of the project we did some work. I do the same, I set up a sort of wiki (an index, a …

Member Avatar for invisal
0
608
Member Avatar for jstfsklh211

It happens because you're using NULL values, for the series *it's not a bug, it's a feature:* * https://bugs.mysql.com/bug.php?id=8173

Member Avatar for Teddy112
0
1K
Member Avatar for divyasuraya

Hi, you should give us more details: * what looks like the input? * are you using utf8 or another encoding? * do you get the expected input? * do you get the expected output from the `preg_replace()`? At the moment your `preg_replace()` pattern is removing spaces and special characters …

Member Avatar for cereal
0
244
Member Avatar for janicemurby

Hi! It happens because: $data = $this->_db->get('users', array($field, '=', $user)); is not returning the object. It could be because the query failed or for something else, sure `_db` it's a property and not a method? For example: $data = $this->_db()->get('users', array($field, '=', $user)); What can be returned by the `get()` …

Member Avatar for cereal
0
6K
Member Avatar for mexabet

Let's try. The error you are reporting: > MySQL said: Documentation > 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '$sql = "SELECT im_image, im_thumbnail FROM tbl_image WHERE im_id = '$imgId' …

Member Avatar for cereal
0
784
Member Avatar for jKidz

Yes, you can by using `concat_ws()` MySQL function, for example: UPDATE table1 SET color = concat_ws(',', color, 'green') WHERE id = XX; But it leads to other problems, for more information read this: * https://www.daniweb.com/programming/databases/threads/473216/alternative-way-of-an-insert-with-where-clause

Member Avatar for diafol
0
213
Member Avatar for batoolhussain
Member Avatar for Safina_1

Is it stored as HTML with an `<img>` tag? If affirmative then you could use a regular expression to extract the image link. For example: $content = ' <p>Title</p> <div><img class="hello" src="/images/ocean001.jpg" id="img"></div> <p>Blue</p> '; $pattern = '/<img[^>]*src[\s]?=[\s]?["']?([^"']*)[^>]*>/i'; preg_match($pattern, $content, $matches); print_r($matches); It should return: Array ( [0] => <img …

Member Avatar for Safina_1
0
644
Member Avatar for AntonyRayan

Are you using an application password? Read here: * https://support.google.com/accounts/answer/185833?hl=en

Member Avatar for cereal
0
236
Member Avatar for lewashby

Hi, you are submitting a single string to the PDO constructor: $connection = new PDO("mysql:host=$host; dbname=$db_name, $db_user, $password"); instead they should be three: dsn, username, password. Or four if [appending options](http://php.net/manual/en/ref.pdo-mysql.php#103501): $connection = new PDO("mysql:host=$host;dbname=$db_name", $db_user, $password);

Member Avatar for lewashby
0
659
Member Avatar for mexabet

> Warning: mysql_query() expects at most 2 parameters, 3 given in admin\modify-password.php on line 40 It happens because this function does not support prepared statements, and it only accepts two arguments: mixed mysql_query ( string $query [, resource $link_identifier = NULL ] ) Where the first argument is the query, …

Member Avatar for mexabet
0
352
Member Avatar for Pavan_9
Member Avatar for cereal
0
460
Member Avatar for AazibKhan
Member Avatar for gabrielcastillo

An alternative: $t = call_user_func_array('array_merge_recursive', $r); where `$r` is diafol's example array and it will return: Array ( [sub_total] => Array ( [0] => 1000 [1] => 120 ) [total_tax] => Array ( [0] => 82.5 [1] => 9.9 ) [total] => Array ( [0] => 1087.5 [1] => 129.9 …

Member Avatar for cereal
0
357
Member Avatar for UK-1991

On line 3 you're looping index 1 of the **$matches** array: foreach($matches[1] as $match) So, due to the structure of this array, **$match** will be a string. Try this to get the values: $values = array(); foreach($matches[1] as $match) $values[] = str_replace("'", "", explode('shortcode id=', $match)[1]); But you can change …

Member Avatar for cereal
0
197
Member Avatar for Abbas Ansari

**@ganeshvasanth** please open your own thread and share what you have done, so we can understand where is the problem.

Member Avatar for cereal
0
19K
Member Avatar for Sophia_1

I think Pritaeas was asking for the database table structure, so open a MySQL client and run: show create table `report`; And return the result here, then run an example query to show us how your data was stored. The best would if you setup an SQLFiddle with some data: …

Member Avatar for Sophia_1
0
281
Member Avatar for LibraryCode

It's deprecated: * https://codeigniter.com/user_guide/libraries/cart.html So it's better to not adopt it, unless you want to update that code on your own. The point is this: **PHP 5.6** is going to be unsupported by the end of August 2017, the CodeIgniter team will not port CI 3 to new versions of …

Member Avatar for cereal
0
152
Member Avatar for janicemurby

> Fatal error: Call to undefined function Age() in /home/jktempla/public_html/signup.php on line 55 Hi, it's the same type of error you got in your previous thread: * https://www.daniweb.com/programming/threads/501605/fatal-error-call-to-undefined-function-getuser-in-homematurecopublic_

Member Avatar for cereal
0
216
Member Avatar for Tinnin

Apache can load a module to control the upload/download bandwith, this is not a default setting, so you should check with your hosting if there are any limits. You can also try to see the headers sent and received by the uploading session. Also Apache can set the post max …

Member Avatar for cereal
0
325
Member Avatar for janicemurby

It means that you have not included the named function in the current script, if you grouped some common functions then you have to include such collection. Again, please refrain to use MySQL API, PHP 7 has been released and this API is not anymore supported, also you MUST use …

Member Avatar for janicemurby
0
541
Member Avatar for janicemurby

Can you open the logo link directly from the browser address bar? For example: http://website.tld/images/logo/logo.png What is the value of `SITE_FAVICON`?

Member Avatar for janicemurby
0
299
Member Avatar for texxs

I have to say that I haven't tested Skeleton, I will try it. And about the others: none of those, I prefer Pure: http://purecss.io/ I ended writing my own, very basic, less frustration.

Member Avatar for Dervish1
0
146
Member Avatar for Teun_1

With *best way to build* you mean that it should be: * responsive * usable offline * provided with access control levels (ACL) * easy to develop * easy to mantain * else? Since it's internal you could use an [agile programming approach](https://en.wikipedia.org/wiki/Agile_software_development): start with basic functions, then add what …

Member Avatar for cereal
0
233
Member Avatar for lewashby

> which one needs to have phpmyadmin installed on it, the web/php server or the machine I'm developing from. If the database is accessible from remote then you can install PHPMyAdmin wherever you want, just edit the **config.inc.php** file to set the IP of the database in the **host** index, …

Member Avatar for cereal
0
4K
Member Avatar for Florea

To see which tables are involved check their database schema: * http://doc.prestashop.com/display/PS14/Fundamentals But the question is: you have to do this programmatically or not? If no, then you can use MySQL Workbench: * http://www.mysql.com/products/workbench/ * https://dev.mysql.com/doc/workbench/en/wb-admin-export-import-table.html Otherwise there are few possible solutions, **depending on which permissions you have on database …

Member Avatar for cereal
0
979
Member Avatar for janicemurby

By removing the [error control operator `@`](http://php.net/manual/en/language.operators.errorcontrol.php) from this line do you get an error? if(@mysql_num_rows($data)>0) And if affirmative, have you tried to get the error returned by the select query?

Member Avatar for cereal
0
223
Member Avatar for vikasmca2k11

*/me `I can see flames of war coming o_o`* I would say because it's easy to use and, at the moment, it's easy to replace developers.

Member Avatar for invisal
0
189
Member Avatar for rpv_sen

Hi, I have few questions: 1. in your tags there are PHP and database: how these are involved in this issue? 2. The static files are served directly or by script? 3. Are these files stored into a folder accessible from remote? 4. Are you trying to block access to …

Member Avatar for rpv_sen
0
817
Member Avatar for UK-1991

You can append the query string to the link and then access it through `$_GET` as in pure PHP or by using `$this->input->get('keyword')`. For example, you have controller **Blog** with method **show($title_slug)** and you want to append a query string to show the **comments**, your link would look like: http://website.tld/blog/show/hello-world-title?comments=on …

Member Avatar for UK-1991
0
291
Member Avatar for solomon_13000

Try to remove the WHERE condition, just to see if the query returns something and what is assigned to `:targetID`: $f15 = "SELECT sum(cost), :targetID as 'target' FROM ingredients"; And in output do: error_log(print_r($g5, TRUE)); So you get the full array.

Member Avatar for diafol
0
3K
Member Avatar for Deep_4

Hi, > What Languages/Frameworks to use? If your goal is to create an application rather than learning a new language/framework, then use what you know best. > where to start? You could start by doing some research about external books APIs: like public libraries or like commercial sites as Amazon, …

Member Avatar for diafol
0
331
Member Avatar for AntonyRayan

Hi, I've suggested you a solution some time ago: * https://www.daniweb.com/programming/web-development/threads/497916/diference-between-two-dates Have you tried that library?

Member Avatar for Taywin
0
293
Member Avatar for varun_6

Hi, **can you access MySQL from command line client?** By running below you should be able to access it: mysql -uroot And if affirmative **can you run queries in database?** In some cases, due to different installation sources, some libraries are overwritten and the server fails to return data, you …

Member Avatar for cereal
0
3K
Member Avatar for Sophia_1

Hi, small note: in your IF statementes `if('$month'==2)` (and co.) you are comparing literally the word **$month**, not his value, against the integer. Single quotes will NOT parse the variable, so in this case you can remove them and write: if($month == 2) Or with double quotes: if("$month" == 2) …

Member Avatar for cereal
0
5K
Member Avatar for kgizo

Hi, in PHP you could move the uploaded file to a directory outsite **public_html**, so that is not directly accessible by a remote client, the file then can be served only through a script. If you cannot move it out, then you can use .htaccess rules to limit the access …

Member Avatar for Taywin
0
229
Member Avatar for Dani
Member Avatar for janicemurby

You have to invert the arguments: first the link to the resource, then the database name. Like this: mysqli_select_db($conn, DBNAME);

Member Avatar for diafol
0
267

The End.