2,113 Posted Topics
Re: By the way: you can use `$deck = range(1, 52);` to get the numbers array, each entry will be an integer. | |
Re: 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, … | |
Re: 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 … | |
Re: **@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 … | |
Re: 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. | |
Re: 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 | |
Re: Memcached is not available, it is in Ondřej ppa, but still not official: * https://launchpad.net/~ondrej/+archive/ubuntu/php-7.0 ![]() | |
Re: 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 … | |
Re: 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, … | |
Re: 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 … | |
Re: 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 … ![]() | |
Re: > 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 … | |
Re: 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 | |
Re: 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 … | |
Re: 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()` … | |
Re: 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' … | |
Re: 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 ![]() | |
Re: 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 … | |
Re: Are you using an application password? Read here: * https://support.google.com/accounts/answer/185833?hl=en | |
Re: 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); | |
Re: > 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, … | |
Re: This should give you some information: http://stackshare.io/etsy/etsy | |
Re: What have you done? ![]() | |
Re: 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 … | |
Re: 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 … | |
Re: **@ganeshvasanth** please open your own thread and share what you have done, so we can understand where is the problem. | |
Re: 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: … | |
Re: 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 … | |
Re: > 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_ | |
Re: 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 … | |
Re: 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 … | |
Re: 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`? | |
Re: 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. | |
Re: 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 … | |
Re: > 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, … | |
Re: 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 … | |
Re: 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? | |
Re: */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. | |
Re: 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 … | |
Re: 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 … | |
Re: 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. ![]() | |
Re: 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, … ![]() | |
Re: 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? | |
Re: 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 … | |
Re: 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) … | |
Re: 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 … | |
Re: You have to invert the arguments: first the link to the resource, then the database name. Like this: mysqli_select_db($conn, DBNAME); ![]() |
The End.