• Member Avatar for cereal
    cereal

    Replied To a Post in Laravel- Multiauth is not working

    Hi, the article you're reading seems a bit outdated and it does not support the Laravel Auth system, in 5.2 now you can specify you're own guards, follow: * https://laravel.com/docs/5.2/authentication#authenticating-users …
  • Member Avatar for cereal
    cereal

    Replied To a Post in where are the forums ???

    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 …
  • Member Avatar for cereal
    cereal

    Gave Reputation to RudyM in Is this SQL query correct?

    I would look into using prepared statements: http://php.net/manual/en/mysqli.quickstart.prepared-statements.php
  • Member Avatar for cereal
    cereal

    Replied To a Post in Retrieve specific row in SQL

    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 …
  • Member Avatar for cereal
    cereal

    Replied To a Post in Session variables ($_SESSION['username']) inside a function

    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 …
  • Member Avatar for cereal
    cereal

    Began Watching client-side Image size/type validation (demo)

    Will work on latest:Chrome Safari Firefox Opera and all versions of IE. *(client notifications are for demonstration purposes only, and subject to designer decisions and modifications ) Can be used …
  • Member Avatar for cereal
    cereal

    Stopped Watching client-side Image size/type validation (demo)

    Will work on latest:Chrome Safari Firefox Opera and all versions of IE. *(client notifications are for demonstration purposes only, and subject to designer decisions and modifications ) Can be used …
  • Member Avatar for cereal
    cereal

    Began Watching client-side Image size/type validation (demo)

    Will work on latest:Chrome Safari Firefox Opera and all versions of IE. *(client notifications are for demonstration purposes only, and subject to designer decisions and modifications ) Can be used …
  • Member Avatar for cereal
    cereal

    Stopped Watching client-side Image size/type validation (demo)

    Will work on latest:Chrome Safari Firefox Opera and all versions of IE. *(client notifications are for demonstration purposes only, and subject to designer decisions and modifications ) Can be used …
  • Member Avatar for cereal
    cereal

    Began Watching client-side Image size/type validation (demo)

    Will work on latest:Chrome Safari Firefox Opera and all versions of IE. *(client notifications are for demonstration purposes only, and subject to designer decisions and modifications ) Can be used …
  • Member Avatar for cereal
    cereal

    Replied To a Post in PHP SQL INJECTION

    **@hielo** hi! On MySQL you can use the `SET` clause in the `INSERT` statement, both syntaxes are supported, see: * http://dev.mysql.com/doc/refman/5.7/en/insert.html
  • Member Avatar for cereal
    cereal

    Replied To a Post in MySQL days/weekdays between two dates

    To get the difference between two dates you can use `datediff()`: * http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html#function_datediff To get the difference without weekends you could also do: drop function if exists diffdate; delimiter // …
  • Member Avatar for cereal
    cereal

    Replied To a Post in PHP SQL INJECTION

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

    Replied To a Post in What's the correct way to write this query

    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 …
  • Member Avatar for cereal
    cereal

    Replied To a Post in insert multiple records in one table php/mysql

    **@monica2016** Hello, please open a new thread. I haven't downvoted your post but you should follow our community rules: * https://www.daniweb.com/community/rules
  • Member Avatar for cereal
    cereal

    Replied To a Post in sql select most repeated value by date

    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 …
  • Member Avatar for cereal
    cereal

    Replied To a Post in [PHP] is_int is false on integer?

    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
    cereal

    Replied To a Post in Only first SQL row is getting understood

    **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 …
  • Member Avatar for cereal
    cereal

    Replied To a Post in Joomla Component Editing

    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 …
  • Member Avatar for cereal
    cereal

    Replied To a Post in PHP- Preg_replace tag name and its contents

    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: …
  • Member Avatar for cereal
    cereal

    Replied To a Post in contact mail in php using SMTP

    Sorry, due to the PHPMailer tag I thought you were using the [library.](https://github.com/PHPMailer/PHPMailer) From what I see you're using `fsockopen()` which works, but depending on the authentication mode your SMTP …
  • Member Avatar for cereal
    cereal

    Replied To a Post in What is the main Differences between Null value and blank?

    What's the default for the `Authorisation` column? It could be: -- case 1 `Authorisation` VARCHAR(40) DEFAULT NULL -- case 2 `Authorisation` VARCHAR(40) DEFAULT '' I don't know how MS Access …
  • Member Avatar for cereal
    cereal

    Replied To a Post in contact mail in php using SMTP

    > 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 …
  • Member Avatar for cereal
    cereal

    Replied To a Post in PHP Changing Image Every 2 Hours

    Independently for each user?
  • Member Avatar for cereal
    cereal

    Replied To a Post in Simple PDO MySQL insert

    You're welcome!
  • Member Avatar for cereal
    cereal

    Replied To a Post in Simple PDO MySQL insert

    > Have you tried this script and looked at the database? No, I don't need to test this. Fix the database connection string: $dbh = new PDO("mysql:host=$hostname;$dbname", $username, $password); It's …
  • Member Avatar for cereal
    cereal

    Replied To a Post in Simple PDO MySQL insert

    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 = …
  • Member Avatar for cereal
    cereal

    Replied To a Post in Attendance form help part 4

    Ok, first of all: your `UPDATE` query had `;` after *timeIn* and *timeOut* columns, due I think, to a copy & paste: `timeIn`= '".mysql_real_escape_string($timeIn).";, `timeOut`= '".mysql_real_escape_string($timeOut).";, It would raise an …
  • Member Avatar for cereal
    cereal

    Replied To a Post in Attendance form help part 4

    In addition to **RudyM's** comment, you're mixing `mysql_` functions with `mysqli_` functions. The [formers are deprecated in PHP 5.* and **removed** in PHP 7.*](http://php.net/manual/en/mysqlinfo.api.choosing.php), which is the latest stable PHP …
  • Member Avatar for cereal
    cereal

    Replied To a Post in Attendance form help part 4

    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 …
  • Member Avatar for cereal
    cereal

    Replied To a Post in loader on form submit

    Are you using `event.preventDefault()`? Docs: https://api.jquery.com/event.preventdefault/
  • Member Avatar for cereal
    cereal

    Replied To a Post in Converting XML data to FILENAME.xml

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

    Replied To a Post in Friendly Time Function

    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 …
  • Member Avatar for cereal
    cereal

    Replied To a Post in Add tag to HTMl file head section

    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 …
  • Member Avatar for cereal
    cereal

    Replied To a Post in I want to remove space between tags using PHP

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

    Replied To a Post in Return record ID upon update

    `LAST_INSER_ID()` without arguments will return the last inserted id, if you pass the autoincrement key, during an update query, then it will return it, as in my example. This is …
  • Member Avatar for cereal
    cereal

    Replied To a Post in Return record ID upon update

    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 …
  • Member Avatar for cereal
    cereal

    Replied To a Post in Calculating a column value from other columns in the same table

    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
    cereal

    Replied To a Post in user and admin php login

    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, …
  • Member Avatar for cereal
    cereal

    Gave Reputation to rch1231 in Why testers are dumb?

    I have always considered the following when writing a program: When you write a program that is idiot proof the world builds a better idiot.
  • Member Avatar for cereal
    cereal

    Replied To a Post in set a custom header using phpmailer

    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: …
  • Member Avatar for cereal
    cereal

    Replied To a Post in How to put slice image into html?

    > Yes I know css.. Do you have any solution? Yes, using `background-image` for example, but I cannot suggest you the perfect solution as I haven't seen your design, nor …
  • Member Avatar for cereal
    cereal

    Began Watching online shopping

    I started new Ecommerce website ..developed in php.(codeigniter)..and it is SEO friendly but we are in only gifting category .but any one please suggest me how attract people to our …
  • Member Avatar for cereal
    cereal

    Replied To a Post in How to put slice image into html?

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

    Replied To a Post in Unable to "drop" (delete) a database in phpMyAdmin

    > All of my other databases in there are accepting my permissions, just not this one. Each database has a different folder, if for some reason in that folder there …
  • Member Avatar for cereal
    cereal

    Replied To a Post in Unable to "drop" (delete) a database in phpMyAdmin

    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 …
  • Member Avatar for cereal
    cereal

    Replied To a Post in Attendance form help part 3

    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 …
  • Member Avatar for cereal
    cereal

    Stopped Watching PHP break string up word by word

    Hi guys, I'm working on a project and wanted to know if there is a good / trusted way to break a string apart into words. I want to get …
  • Member Avatar for cereal
    cereal

    Began Watching PHP break string up word by word

    Hi guys, I'm working on a project and wanted to know if there is a good / trusted way to break a string apart into words. I want to get …
  • Member Avatar for cereal
    cereal

    Replied To a Post in PHP CodeIgniter Query

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

The End.