2,113 Posted Topics

Member Avatar for xuexue

Hello, have you tried with a left join? If *table 1* is `reference` then try this example for MySQL: SELECT `r`.`no`, `r`.`referenceno`, `r`.`date`, `m`.`controlno` FROM `reference` AS `r` LEFT JOIN `marine` AS `m` ON `m`.`referenceno` = `r`.`referenceno` AND `r`.`marine` = 'y' ORDER BY `r`.`no`; Live example here: http://sqlfiddle.com/#!9/b2fca/1 Knowing the …

Member Avatar for xuexue
0
234
Member Avatar for jsj1411

Hi, have you tried `http_build_query()`? * http://php.net/manual/en/function.http-build-query.php

Member Avatar for hielo
0
469
Member Avatar for breakzzzz20
Member Avatar for cereal
0
9K
Member Avatar for Stefce

Hi, you can try with the `BETWEEN ... AND` construct in the `WHERE` clause: * http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html#operator_between Example with `date_column`: "SELECT `MatchTitle`, COUNT(`MatchTitle`) AS `mostPlayed` FROM `matches` WHERE `date_column` BETWEEN "2016-05-24 23:59:00" AND "2016-05-25 00:00:00" GROUP BY `MatchTitle` ORDER BY `mostPlayed` DESC LIMIT 1" This will give **1 minute** range. Just …

Member Avatar for cereal
0
230
Member Avatar for Aeonix

Use `intval()` as suggested or `$id = (int) $_GET['id'];`, see: * http://php.net/manual/en/language.types.type-juggling.php Or in case of validation use `filter_input()`: $id = filter_input(INPUT_GET, 'id', FILTER_VALIDATE_INT); Bye!

Member Avatar for cereal
0
275
Member Avatar for Aeonix

**Little note:** consider that the `query()` method will return an iterable object from the **Result class**: * http://php.net/manual/en/class.mysqli-result.php So, if you want to get the next row you have to move the internal pointer, through a loop or through `data_seek()`, which should be used if, for example, you want to …

Member Avatar for makaijohn9
0
442
Member Avatar for garyrichard

Have you tried PHPWhois? [url]http://sourceforge.net/projects/phpwhois/[/url]

Member Avatar for Thirumani_1
0
2K
Member Avatar for oliprik
Member Avatar for Makara

Hi, how you are trying to add the feature: by adding code to the component source? When you say: > I cant access the component in the admin you mean that the changes to the component code don't apply? Or that you cannot upload & install the component through the[ …

Member Avatar for cereal
0
131
Member Avatar for baig772

Hi, you could list the items in the head and body elements and then, if you catch the `style` child, you remove it. This seems to works fine for me: <?php /** * Remove tag from DOM. * * @see http://php.net/manual/en/domnode.removechild.php * Read the comments about the loops * @param …

Member Avatar for cereal
0
2K
Member Avatar for rpv_sen

> I am unable to send a mail. Please help me to fix the issue. Hi, unable in which sense? The script fails the connection with the SMTP or something else? Do you have PHP error logs or SMTP error logs? Replace lines below and including `47` with: if(!$mail->Send()) { …

Member Avatar for cereal
0
832
Member Avatar for dharam_05

**@Vinod** you can do: SELECT * FROM `table_name` WHERE `column_name` = ''; This will return only the empty strings, NULL values will be ignored by the statement. An example: http://sqlfiddle.com/#!9/0aa0bb/1

Member Avatar for jacks009
0
13K
Member Avatar for SpottyBlue

Hi, can you paste just the relevant code? People here can answer also from mobile and cannot setup a database and run your scripts. Also, if the download link becomes unavailable, the thread becomes useless for the readers.

Member Avatar for SpottyBlue
0
249
Member Avatar for James_43

Have you tried with DateTime? <?php $one = '09:30 am'; $two = '11:00 AM'; $time1 = new Datetime($one); $time2 = new Datetime($two); $diff = $time1->diff($time2); print_r($diff); Which outputs a DateInterval object like this: DateInterval Object ( [y] => 0 [m] => 0 [d] => 0 [h] => 1 [i] => …

Member Avatar for James_43
0
309
Member Avatar for infoitmanoj
Member Avatar for rouse

Hi, you're missing the closing parenthesis in the `VALUES()` statement and the commas to separate the data: $count = $dbh->exec("INSERT INTO animals(animal_type, animal_name) VALUES ('kiwi' 'roy'"); Should be: $count = $dbh->exec("INSERT INTO animals(animal_type, animal_name) VALUES ('kiwi', 'roy')");

Member Avatar for cereal
0
581
Member Avatar for facarroll

Hi, I'm not sure I've understood: line 26 of check.php is line 1 of the other code block?

Member Avatar for facarroll
0
385
Member Avatar for AntonyRayan

Are you using `event.preventDefault()`? Docs: https://api.jquery.com/event.preventdefault/

Member Avatar for cereal
0
119
Member Avatar for ruwanaru

Yes, it can be done by getting the `head` element, then by creating an element `link`, appending the attributes to the created element, and finally appending the new element to the head section. An example: <?php $file = './index.html'; $doc = new DomDocument(); $doc->loadHTMLFile($file); $head = $doc->getElementsByTagName('head')->item(0); $link = $doc->createElement('link'); …

Member Avatar for cereal
0
193
Member Avatar for FarrisFahad

Hi, you can `explode()` by comma and `trim()`, try: $tags = 'cats, funny, hair cut, funny hair cut'; $result = array_map('trim', explode(',', $tags));

Member Avatar for FarrisFahad
0
356
Member Avatar for showman13

If the update is limited to a single row, as in your example query, you could add `rec_id = LAST_INSERT_ID(rec_id)` to register the value to the function and then select it, for example: UPDATE tier_".$tier_num." SET payer_ID = '".$payer."', sub_ID = '".$payer_sub."', create_date = '".$created."', status = 'I', rec_id = …

Member Avatar for cereal
0
444
Member Avatar for Harmeet_2

Hi, you can use the Form helper, like in the documentation example: * https://codeigniter.com/user_guide/helpers/form_helper.html?highlight=form#form_dropdown Otherwise you can use custom code. Have you tried to write some code? Show it to us, so we can suggest you how to fix it, bye.

Member Avatar for Ajay Gokhale
0
140
Member Avatar for BabaRoro

Yes, you can, just select and use the `+` operator: select `column_a`, `column_b`, `column_a` + `column_b` as `column_c` from `table_name`; Live example: http://sqlfiddle.com/#!9/935da4/1

Member Avatar for cereal
0
208
Member Avatar for SirMahlon

Sure is `$key` and not `$primaryKey`? protected $primaryKey = 'user_id'; Model source: * https://github.com/laravel/framework/blob/06182c2b498cfc1bbb82e5d49bad0c92d256a337/src/Illuminate/Database/Eloquent/Model.php#L56

Member Avatar for Sikander Nasar
0
620
Member Avatar for Laura_7

Hi, after `if($rows==1){` fetch the row and check the column value that defines the role, use an IF statement to define the session and redirect, something like: if($rows==1) { mysql_data_seek($result, 0); $row = mysql_fetch_assoc($result); # admin if($row['role'] == 1) { $_SESSION['role'] = 1; header("Location: /admin/"); exit; } # user $_SESSION['role'] …

Member Avatar for cereal
0
2K
Member Avatar for dravos

Hi, you can use the `addCustomHeader()` method, for example: <form method="POST"> <input type="text" name="companyName"> </form> on PHP side you do: $companyName = sprintf("CompanyName: %s", $_POST['companyName']); $mail->addCustomHeader($companyName); Check the syntax at: * http://phpmailer.worxware.com/?pg=methods And remember always to sanitize the input.

Member Avatar for cereal
0
105
Member Avatar for Ricardo_1

Hi, it seems related to the permissions of OS user that is running the MySQL server, it seems this user cannot delete the directory that stores the database. Try to restore the permissions and, to remove the database, check the PHPMyAdmin data directory to manually remove this specific directory.

Member Avatar for Ricardo_1
0
6K
Member Avatar for ShilohAmi

Hi, do you know about [cascading](https://www.w3.org/Style/CSS/learning.en.html) [style](http://www.westciv.com/style_master/academy/css_tutorial/) [sheets?](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Getting_started)

Member Avatar for gentlemedia
0
324
Member Avatar for Prateek_2
Member Avatar for Arfan_1
0
6K
Member Avatar for SpottyBlue

Hi, I think you're confused by [my previous post](https://www.daniweb.com/programming/web-development/threads/504130/attendance-form-help-2#post2202708). The input type `time` is not boolean, so to see the value you must set it in the `value` attribute, so instead of: <td><input type="time" name="timeIn" id="timeIn" <?php echo $row['timeIn'] > 0 ? ' time':''; ?>></td> Do: <input type="time" name="timeIn" id="timeIn" …

Member Avatar for cereal
0
305
Member Avatar for SpottyBlue

Hi > And also, the checkbox says it's all ticked even the values are different (lines 61 - 63 of index.php) what do you mean?`checked` is a boolean attribute, which means: > A number of attributes are boolean attributes. The presence of a boolean attribute on an element represents the …

Member Avatar for SpottyBlue
0
395
Member Avatar for RudyM

Hi, try to submit the `WHERE` condition as a string: $where = "new_col = 0xD9E6762DD1C8EAF6D61B3C6192FC408D4D6D5F1176D0C29169BC24E71C3F274AD27FCD5811B313D681F7E55EC02D73D499C95455B6B5BB503ACF574FBA8FFE85"; $this->db->get_where("user_stats_backup", $where);

Member Avatar for RudyM
0
318
Member Avatar for RikTelner

It would be a lot easier by using an autoload script, namespaces and some classes or some helper files. For some ideas, read: http://stackoverflow.com/questions/4737199/autoloader-for-functions

Member Avatar for cereal
0
460
Member Avatar for sahilmohile15

Hi, which library are you using? In the UI I only see `dialog()` not `modal()`. Build an example page with full requirements, so that we can test, or share the libraries you're using. A part that you could check the values sent to the form through `console.log(jQuery('#sizes').val());` in browser side …

Member Avatar for cereal
0
977
Member Avatar for Ilja.vas

You question is not clear, files are copied in the usb? How big are these 10 files?

Member Avatar for CimmerianX
0
237
Member Avatar for rahulmukati

Hi, the `foreach` construct only accept these syntaxes: foreach (array_expression as $value) And: foreach (array_expression as $key => $value) it seems you're trying to extract two keys, it won't work. The `array_combine()` function does accepts only two arguments, you're submitting three arguments (arrays) so it will fail. If these are …

Member Avatar for cereal
0
151
Member Avatar for iveto89
Member Avatar for RikTelner

It's up to you. I use arrays, like: <?php return [ 'paths' => [ 'images' => '/path/to/images/directory/', 'styles' => '/path/to/styles/directory/', # ... ], # ... ]; And/or dotenv: https://github.com/vlucas/phpdotenv

Member Avatar for jkon
0
247
Member Avatar for dlmagers
Member Avatar for cereal
0
359
Member Avatar for RikTelner

With **MySQL** you can use `FIND_IN_SET()`: SELECT * FROM `example` WHERE FIND_IN_SET(192, `paricipantsId`); **Docs:** http://dev.mysql.com/doc/refman/5.7/en/string-functions.html#function_find-in-set Or, if you need something more complex and you switch to **MariaDB**, then you can use some new features for **dynamic columns**: * https://mariadb.com/kb/en/mariadb/dynamic-columns/ However, instead of storing this information in CSV style, consider to …

Member Avatar for cereal
0
160
Member Avatar for RikTelner

Concerning the color: it can be different due to the monitor calibration, you should calibrate in both systems to get the same results.

Member Avatar for RikTelner
0
227
Member Avatar for davy_yg

Hi Davy, could you please use the code tag when you share code on this forum?

Member Avatar for cereal
-1
167
Member Avatar for Lek_Plepi

Hi, you mean you want to send an email in HTML format rather than plain-text? Check **example 4** in the documentation of the `mail()` function: * http://php.net/manual/en/function.mail.php However, I suggest you to look into libraries like PHPMailer or SwiftMailer.

Member Avatar for cereal
0
197
Member Avatar for Engr.
Member Avatar for jkon
-2
189
Member Avatar for Stefce
Member Avatar for Jiby_1

Hi, the *above* code will download the file to the web server executing the script, not to the home directory of the client browser. In practice: if the path `/home/jiby/Downloads/image.jpg` does not exists in the web server root, then the script will fail.

Member Avatar for cereal
0
94
Member Avatar for RahulAdmane

Hi, follow the documentation and read also the comments on the same page: * http://php.net/manual/en/features.file-upload.multiple.php

Member Avatar for cereal
0
124
Member Avatar for panduranga_1

In addition: check also about **composer**, it's a dependency manager for PHP, most frameworks support it and it allows to easily share and include libraries into a project: * https://getcomposer.org/ However you don't really need to use a framework to take advantage of composer, you can use flat PHP. A …

Member Avatar for vps9.net
0
218
Member Avatar for spud91
Member Avatar for masimies

Hi, it happens because the `header('Location: url');` will be overwritten by the last loop value, which is what will be executed. You cannot start multiple redirections. Also, what is this line supposed to do? $key . " : " . $value . ""; Print?

Member Avatar for masimies
0
320

The End.