2,113 Posted Topics
Re: If the invoice numbering goes, for example, from 2009/04/01 to 2010/03/31 then the column year should take both years or the full date string, something like: 2009-2010 Or: 20090401-20100331 Then it can work as you desire: create table invoices( years char(9) not null, invoice_number int unsigned not null auto_increment, primary … | |
Re: Hi, dont' use `+` to concatenate strings like in javascript, use dots: die ("Cannot delete data from the database! " . mysql_error()); ![]() | |
Re: > I need to generate six tables one by one but i am not able to generate with proper alignment its running out of page Hi, can you provide some sample data, for example how the array in `$data2` is structured, and a screenshot or a generated PDF could be … | |
Re: Hi, this happens in Javascript and PHP when using float numbers, to avoid this problem you can use the **BC Math** library: echo bcdiv(bcmul(47.60, 554.82), 100, 2); Which returns `264.09`, the third argument of `bcdiv()` is rounding to the second decimal. If you want `264` then remove the third argument: … | |
Re: Those are control words, used as the HTML tags to give formatting to the document. If you want to convert the above to plain-text then try this library: - https://github.com/joshribakoff/rtf Regarding `application/octet-stream` this is a generic mime used for binary data, you can get an `.exe` as a `.doc` with … | |
Re: **@AndrisP** By the way, do not use `$_SERVER['HTTP_HOST']` because it can be set by the client header request, it's not a value set by the server, so it can be dangerous. Bye! | |
Re: Hi, if you're referring to the execution time of a PHP script, then change the value of `max_execution_time`: * http://php.net/manual/en/info.configuration.php#ini.max-execution-time The value can be modified at PHP level through the function `ini_set()`, or by editing your **php.ini** file. Default is 30 seconds. If the problems starts while submitting the input, … | |
Re: Hi, you can include it via composer, in your shell write: composer require lightopenid/lightopenid:dev-master Or edit **composer.json** and to `require` add: "lightopenid/lightopenid": "dev-master" And perform `composer update` from the terminal. I didn't tested, but it should work like this: Route::get('/openid', function() { $opID = new LightOpenID('yourdomain.tld'); if( ! $opID->mode) { … | |
Re: If you simply paste the url into the html output, then it will be the client (i.e. the browser of the user) to execute the request to the remote server, your server in this case won't be involved. But there are at least two problems with your approach: 1. a … | |
Re: Hi, check the `name` index: $_FILES['datafile']['name'] Below you can read the full array structure returned by `$_FILES`: * http://php.net/manual/en/features.file-upload.post-method.php | |
Re: Hello, first, are you sure your script can access the link? Because from the browser, it displays fine, but from script it returns error 503, that's due to a restriction. I had to set a **user agent** through a stream context to the `file_get_contents()`: // Create a stream $opts = … | |
Re: By the way, use another website for the check: Google doesn't allow to be embedded into external frames and if you load the javascript console, you'll see the reason: Refused to display 'https://www.google.com/?gws_rd=ssl' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN' It depends on the `X-Frame-Options` header. Whenever a … | |
Re: Hi, let me understand: do you want an autocomplete function over an input text field? Or a select dropdown? Also, can you show the form? | |
Re: It generally happens when you output something before the `header()` function, for example: <?php echo 'hey!'; header('Location: /'); You should write your script to avoid these situations or, if you can modify your php.ini, then you can change the `output_buffering` directive to `4096` or to `On`, for more information check … | |
Re: Change `post_max_size`, default is 8MB and by conseguence modify also `memory_limit`, it must be higher than `post_max_size`: * http://php.net/manual/en/ini.core.php#ini.post-max-size | |
Re: It's not cool to kick trashcans Dani :p I hope you'll get better soon! | |
Re: *Sounds* like you've reached the size limit. Check the contents of `$_FILES` array by placing this at the top of your upload script: die(print_r($_FILES)); Then check the value of the index key `error`, if you get `0` there's no errors, so you will may want to paste your code here. … | |
Re: Try with the flow control function `CASE`: * http://dev.mysql.com/doc/refman/5.5/en/control-flow-functions.html#operator_case I don't know your table structure, so here's an example: * http://sqlfiddle.com/#!2/a9e87/3 Bye! | |
Re: Try with `appendImages()`, like in this example: <?php $list = array( './i/001.jpg', './i/002.jpg', './i/003.jpg', './i/004.jpg' ); # first image to start Imagick() $im = new Imagick($list[0]); $ilist = array(); # loop the others for($i = 1; $i < count($list); $i++) { $ilist[$i] = new Imagick($list[$i]); $im->addImage($ilist[$i]); } $im->resetIterator(); $combined = … | |
Re: First problem: <p>Budget<br /> <input id="subject" name="subject" class="text" /> </p> <p>Nature of Business<br /> <input id="subject" name="subject" class="text" /> </p> Here you have two input fields with same **id** and the same **name**, you can use the same name, as long you use an array `name=subject[]` but it's better to … | |
Re: It seems possible by adding a filter, read the documentation: * http://codex.wordpress.org/Custom_Queries * http://codex.wordpress.org/Function_Reference/add_filter * http://codex.wordpress.org/Plugin_API/Filter_Reference * http://codex.wordpress.org/Plugin_API/Filter_Reference/posts_orderby | |
Re: Hi, have you tried this? * http://jqueryui.com/autocomplete/ * http://api.jqueryui.com/autocomplete/ | |
Re: Hi, if you choose PHP then use variables, for example: <p>Client Name: <?php echo "$firstname $lastname"; ?></p> To assign the values to the variables `$firstname` and `$lastname` you can use the input submitted by a form: <form method="post" action="document.php"> <label for="firstname">Firstname:</label> <input type="text" name="firstname" /> <br /> <label for="lastname">lastname:</label> <input … | |
Re: In addition read this thread: * http://www.daniweb.com/web-development/databases/threads/473598/is-better-store-images-in-a-blob-or-in-directories | |
Re: You can save the datetime as UTC in the `posts` table, and then convert it to the user timezone, basing on his profile preferences. For example: <?php $times = DateTimeZone::listIdentifiers(); $utc = key(array_slice($times, -1, 1, TRUE)); $getTZ = array_key_exists('tz', $_GET) ? (int)$_GET['tz'] : $utc; # generate list of timezones $list … ![]() | |
Re: Hi, It seems you're using some **user defined** functions: `apologize()`, `query()`, `render()` and `redirect()` are not PHP functions, so we cannot help much. Check the included file at the top of the script, it should contain those functions and the instructions on their results. Anyway, on line `51` you wrote: … | |
Re: Hi, try to append the query string to the action of the form: <form method="post" action="receiving.php?<?php echo $_SERVER['QUERY_STRING']; ?>"> Or use an hidden input field: <input type="hidden" name="code" value="<?php echo $_SERVER['QUERY_STRING']; ?>" /> But in this last case, then check for `$_POST['code']` instead of `$_GET['code']`. Or, if you're using `$_SESSION`: … | |
Re: If the condition doesn't match then redirect with an error message, for example: <?php session_start(); if($_POST['submit']) { $db = /* connection to database */ $stmt = $db->prepare("SELECT username FROM users WHERE username = ?"); $stmt->execute(array($_POST['username'])); $row = $stmt->fetch(PDO::FETCH_NUM); # if FALSE then the username does not exists if($row === false) … | |
Re: Place `session_start()` on top of this script otherwise `$_SESSION` won't be loaded and the IF statement will return false. Bye! | |
Re: From your panel you should be able to set up a redirect, check this: * http://support.hostgator.com/articles/cpanel/url-redirect-how-to-create | |
Re: Hi, can you paste an output hash? For example, I tried this: * http://runnable.com/U7VgPEukzj4rsw6n/java-hash-test And it returns the same hash of `md5()` in PHP: echo md5("hello"); // 5d41402abc4b2a76b9719d911017c592 But I don't know JAVA well, so my example could be wrong. | |
Re: Hi, the query at line `18` is not correct because you're going to set `1` to the `unfavorite` column, no matter what is the value of `$_REQUEST['favorite']`. Try to avoid `$_REQUEST` and use `$_POST` or `$_GET`, otherwise the script can receive input from different sources: cookies, post & get requests. … | |
Re: As Pritaeas asked, did you got errors? Maybe I'm missing a point, but I'm taking some samples from [here](http://samples.mplayerhq.hu/SWF/) and it seems I can convert swf files without any problems, both with `ffmpeg` and `avconv`: ffmpeg -i source.swf out.mp4 avconv -i source.swf -b 128k output.mp4 Also you can list supported … | |
Re: Remove all the spaces at the left side of `EOF;` and then go to a new line, so remove also any spaces after `EOF;`, so: <?php require_once 'config.php'; $title = "Home!"; $content = <<<EOF <h3>Current Statistics</h3> Our Home Page! EOF; include 'layout.php'; ?> From documentation: > The closing identifier must … | |
Re: Hi, can you show the form? Looking at the array output, it seems most of the values are under the index key `txtbox` while only the first is under `txt` which is the one you're trying to loop: array(4) { ["txt"]=> array(1) { [0]=> string(5) "item1" } ["qty"]=> array(1) { … | |
Re: Look at `group_concat()` in MySQL: * http://dev.mysql.com/doc/refman/5.5/en/group-by-functions.html#function_group-concat To create a query like this: select s.name, group_concat(sa.artist order by sa.artist) as artists from songs s, songartists sa where s.id = sa.sid group by sa.sid; But I would create an `artists` table, so you don't have to repeat the same artist each … | |
Re: Otherwise use `INSERT ... ON DUPLICATE KEY UPDATE`, you have to create a unique key index: ALTER TABLE tablename ADD UNIQUE KEY(pg_name,mem_id,ct_year,ct_month); Then your insert query becomes: INSERT INTO tablename (pg_name, mem_id, ct_year, ct_month, count) VALUES('page.html', 1, 2014, 7, 1) ON DUPLICATE KEY UPDATE count = count + 1; Docs: … | |
Re: Do you have write permissions on `songs` directory? | |
Re: Try by adding a backslash: mv Abhishek\�_xyz.docx newname.docx Or with double quotes: mv "Abhishek�_xyz.docx" newname.docx Or by using a wildcard: mv Abhish* newname.docx By the way which kind of shell are you using? Bash? | |
Re: It's probably due to this: > If you are using MySQL 3.23 or later, you can copy the .frm, .MYI, and .MYD files for MyISAM tables between different architectures **that support the same floating-point format.** And: > If you want to move applications to another machine having a different architecture … | |
Re: Are you using Eloquent? If yes, right after you save something call the `id` property, for example: $post = new Post; $post->title = 'Title'; $post->body = 'Bla bla bla...'; $post->save(); $post->id; // <- last inserted id Otherwise use the `insertGetId()` method: $id = DB::table('users')->insertGetId( array('email' => 'john@example.com', 'votes' => 0) … | |
Re: Hi, can you show some example data and the table structure? | |
Re: Hi, set a slave for the log database, then stop the replication, read the data you need and restart the replication: * http://dev.mysql.com/doc/refman/5.6/en/replication.html | |
Re: Hi, start from PHP documentation: * http://www.php.net//manual/en/features.file-upload.post-method.php * http://www.php.net/manual/en/features.file-upload.multiple.php Then, if you have difficults, show your code. | |
Re: Hi, to be sure ask to the hosting support, regarding OpenShift check this link: * https://www.openshift.com/developers/openshift-environment-variables it seems you can get the listening IP by echoing few system variables: * OPENSHIFT_<cartridge>_IP * OPENSHIFT_<cartridge>_PORT In practice from ssh run commands like these: echo $OPENSHIFT_APPNAME_IP echo $OPENSHIFT_APPNAME_PORT Source: * http://stackoverflow.com/a/21799762 | |
Re: Hi, remove the curly bracket `}` at line 8. | |
![]() | Re: Version **2.2.0**, released few days ago, fixes this bug. Bye! |
Re: Hi, check line `12` in your config file: the `host` and `dbname` values are hardcoded, change the line with: $db = new PDO("mysql:host={$host};dbname={$dbname}", $username, $password); | |
Re: Also, each subquery requires an alias, for example: select a.total from (select count(*) as total from tablename) as a; Otherwise you get an error, to see it use `mysql_error()`. In addition try this query: $query=mysql_query("select a.total + b.total as total from (select count(*) as total from message_believe as mb where … | |
Re: Have you tried `upper()`? Example: select UPPER(CONCAT('CMRC', LPAD(UUID(), 10, '0'))); * http://dev.mysql.com/doc/refman/5.5/en/string-functions.html#function_upper |
The End.