• Member Avatar for AndrisP
    AndrisP

    Began Watching Going to the next line

    Hello, I wonder why this code won't work: HomeController.php `$content = $email."\n".$phone."\n".$select; ` I expect that it goes to the next line after \n
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in SQL Server delete data with linked Table ?

    ... and referenced column should be unique, in next example all working perfectly drop table if exists `TABHDBHCHUYEN` cascade; drop table if exists `TABHDBHCT` cascade; drop table if exists `IDHDBHCT` …
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in SQL Server delete data with linked Table ?

    Make foreign key constraints with clause `on delete cascade` on the tables 2 and 3 referenced to table 1 and dont use `join` for deleting.
  • Member Avatar for AndrisP
    AndrisP

    Began Watching SQL Server delete data with linked Table ?

    Suppose you have 3 tables: TABHDBH, TABHDBHCHUYEN and TABHDBHCT Table TABHDBH has the following fields: NGAY DateTime; IDHDBH int ... Table IDHDBHCT has the following fields: MAHDBH int ... TABHDBHCHUYEN …
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in Apply text on an object while following the shape

    Read this https://css-tricks.com/snippets/svg/curved-text-along-path/ about SVG textPath
  • Member Avatar for AndrisP
    AndrisP

    Began Watching Apply text on an object while following the shape

    Hey. Any ideas on how I can apply a given text on a certain 2D object, so the text would follow the object shape? Imagine we have this object: http://prntscr.com/gmdv9w …
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in Logic issue in php

    I suggest you use function `filter_input()` $edit = filter_input(INPUT_GET, 'edit', FILTER_VALIDATE_INT); $delete = filter_input(INPUT_GET, 'delete', FILTER_VALIDATE_INT); $brand = filter_input(INPUT_POST, 'brand', FILTER_SANITIZE_STRING); if($edit !== NULL){ $sql = .... } if($delete !== …
  • Member Avatar for AndrisP
    AndrisP

    Began Watching Logic issue in php

    Hey everyone, I have been going over this in my head and can't seem to figure out the solution. I've got a database table called brands and in my form …
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in Parsing XML with Regex and preg_match_all

    Why don't you use the`loadXML` function and then handle it through the DOM object? http://php.net/manual/en/domdocument.loadxml.php
  • Member Avatar for AndrisP
    AndrisP

    Began Watching Parsing XML with Regex and preg_match_all

    I am not a computer professional, only like to develop my own toys. I am using Globi Flow to get the info I need from the XML file. All is …
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in How To Display The Correct Date / Time Format

    Another way - format date in to the db, e.g. $stmt = $conn->prepare("SELECT DATE_FORMAT(`your_date_column`, '%W %M %D') FROM tbl ORDER BY id DESC"); More MySQL date formating info here [here](https://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_date-format)
  • Member Avatar for AndrisP
    AndrisP

    Began Watching How To Display The Correct Date / Time Format

    Hi everyone, Iam trying to figure out how to display the correct time and date format in the following piece of code $stmt = $conn->prepare("SELECT * FROM tbl ORDER BY …
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in How to use WHERE and LIKE with a variable

    My comment will not answer to your question but: Is the column `uid` with type `VARCHAR`? I think it should be integer. If its true then bind variable as `PDO::PARAM_INT` …
  • Member Avatar for AndrisP
    AndrisP

    Began Watching How to use WHERE and LIKE with a variable

    I have a login session where it checks the user name and displays it to the form (it displays FirstName LastName). That username is also being used as a variable …
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in ascending mysql fetch array excluding The or A at start

    order by if( substr(`ord_column`, 1, 2)='A ', substr(`ord_column`, 3), if( substr(`ord_column`, 1, 4)='The ', substr(`ord_column`, 5), `ord_column` ) ) or mutch readable (result will be same) order by case when …
  • Member Avatar for AndrisP
    AndrisP

    Began Watching ascending mysql fetch array excluding The or A at start

    I know how to do a fetch array to create a while loop as well as the mysql query in ASC order. What I'm trying to sort out is how …
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in PHP Sending Email but body just got Array message

    In to the line 5 you are trying to handle `$row` but it not defined in this step function two_dim_array_to_html_table($arr, $header){ $ret = "<table border='1'>\n"; $ret .= "\t<tr>\n"; foreach($arr[0] as …
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in PHP Sending Email but body just got Array message

    On the call function $Body = "<html>\n" . "<head>\n" . "<style>\n" . file_get_contents('style.css') . "</style>\n" . "</head>\n" . "<body>\n" . two_dim_array_to_html_table($result, $colcomments) . "</body>\n" . "</html>\n"; but inside function when …
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in PHP Sending Email but body just got Array message

    You forgot to pass second input parameter when you call function
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in PHP Sending Email but body just got Array message

    You forgot to add the second input parameter to function. Table row tags `<tr>` open and close for column headers is missing. Lines 11. and 12. should be before line …
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in PHP Sending Email but body just got Array message

    Replace function and pass array `$colcomments` as second argument. Then before `foreach($arr as $row)` implement column headers
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in PHP Sending Email but body just got Array message

    Put style attributes directly in to the HTML elements instead of CSS stylesheet
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in PHP Sending Email but body just got Array message

    Create it as function e.g. function two_dim_array_to_html_table($arr){ $ret = "<table border='1'>\n"; foreach($arr as $row){ $ret .= "\t<tr>\n"; foreach($row as $column){ $ret .= "\t\t<td>".$column."</td>\n"; } $ret .= "\t</tr>\n"; } $ret .= …
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in PHP Sending Email but body just got Array message

    Create function for convert array to html table instead of `json_encode`
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in PHP Sending Email but body just got Array message

    Because `$result` is array - do not concatenate as a string
  • Member Avatar for AndrisP
    AndrisP

    Began Watching PHP Sending Email but body just got Array message

    I'm just starting to learn PHP and I'm trying to send my table via email. I am receiving the email but the body just says Array. I dont know where …
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in Multiple update of rows in a single column

    Mark thread as solved
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in Multiple update of rows in a single column

    In fact checkboxes is redundant because rows with no changes will not updated - replace all "checkbox" to "hidden"
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in Multiple update of rows in a single column

    Easiest way to select all by default add attribute checked. Or replace type "checkbox" to "hidden" and remove labels if you dont want deselect.
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in Multiple update of rows in a single column

    About `Undefined variable`: declare variables `$result` and also `$colcomments` - before `try {` in my code example in to the line 86 - e.g. `$result = NULL; $colcomments = NULL;` …
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in Multiple update of rows in a single column

    Try this <?php define('DBhost', 'localhost'); define('DBname', 'trackerdb'); define('DBport', 3306); define('DBuser', 'root'); define('DBpswd', ''); $message = array( 'error' => array(), 'warning' => array(), 'info' => array() ); $bgcol = array( 'error' …
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in Multiple update of rows in a single column

    You are wrong - update will be skipped when it is not set but if you submit updates then need set updates in to the table before you again select …
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in How to parse html content and manipulate it

    Another way - create document object and manipulate any element and its attributes e.g. <?php $content = '<!DOCTYPE html> <html> <head> <title>PAGE TITLE</title> </head> <body> <p>This content has two images</p> …
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in How to parse html content and manipulate it

    <?php $content = 'This content has two images <img src="/images/img1.jpg" alt="Image 1" /> <img src="/images/img2.jpg" alt="Image 2" />'; $content = preg_replace('/\<img src="([^\"]+)" alt="([^\"]+)" \/>/', '<a href="\\1" data-fancybox="image-popup" data-caption="\\2"> <img src="\\1" …
  • Member Avatar for AndrisP
    AndrisP

    Began Watching How to parse html content and manipulate it

    Hello, I am trying to manipulate a HTML content stored in a php variable. The logic is as follows: The variable should be checked if it contains an <img ... …
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in Multiple update of rows in a single column

    Update functions should be before line 28 to take update effects in your `SELECT` All `POST` variables would be better with `filter_input_array()` function e.g. $args = array( 'id' => array( …
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in Multiple update of rows in a single column

    Your `input` tags is not not closed in to the lines 79..84 Lines 15..17 is duplicat of lines 11..13 I recommend use `$date = filter_input(INPUT_POST, 'date');` and `$date1 = filter_input(INPUT_POST, …
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in Multiple update of rows in a single column

    If you want to update only `column3` then do not need put in form other columns <?php echo ' <form action="crqretrieve_status.php" method="post"> <table>'; foreach ($result as $row => $info) { …
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in Multiple update of rows in a single column

    Where from do you get values for update? Its manual input or other?
  • Member Avatar for AndrisP
    AndrisP

    Began Watching Multiple update of rows in a single column

    I am trying to retrieved data from database and update a single column. column1 | column2 | column3 value1 | value1 | ------- value2 | value2 | ------- <=== this …
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in Need mysql query for inactive customers

    select * from some_table where `last order date` < date_sub(now(), interval 3 month)
  • Member Avatar for AndrisP
    AndrisP

    Began Watching Need mysql query for inactive customers

    Hi, i have installed prestashop 1.4.8.2 & i need a report of last order date for each customers, please help me to create mysql query. i need below columns information …
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in I want to display items from mySQL database in grid form using php

    decrease `max-width`
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in I want to display items from mySQL database in grid form using php

    Define in css `float:left;` sizes `max-width` and `max-height` use it class instead of `style="float:left;"`
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in I want to display items from mySQL database in grid form using php

    `$A` need to incremented after `endif;` but print whatever <?php $A=0; while ($auction = $result->fetch_assoc()): if ($A%3==0): ?><br/><?php endif; $A++; ?> <div style="float:left;"> <h4><?=$auction['item_name']?></h4> <img src="<?=$auction['item_image']?>" class="img-responsive"> <span id="countdown" class="timer">how</span> …
  • Member Avatar for AndrisP
    AndrisP

    Began Watching I want to display items from mySQL database in grid form using php

    I want to display records from my database in div and in a grid format using php. I want to set it to display 3 items in a row and …
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in data not inserting into my database table

    1. `mysqli_query()` should be inside `for` (line 15) 2. Use `filter_input()` to sanitize user input variables 3. Bind variables after prepare
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in Unable to delete data from oracle database using php

    1. Read manual about `coommit` http://php.net/manual/en/function.oci-execute.php 2. Bind variables after `oci_parse` to prevent from SQL injection http://php.net/manual/en/function.oci-bind-by-name.php
  • Member Avatar for AndrisP
    AndrisP

    Began Watching Unable to delete data from oracle database using php

    Hey!! i am using php to delete data from database but its not deleting and no error is showing. Please help me. <?php include('connect.php'); $p_No = $_POST['p_No']; $sql2 = "DELETE …
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in Undefined index: username

    1. Replace `method = "POST"` without white spaces `method="POST"` 2. I see in HTML form `name="USERNAME"` and `name="USER_PASSWORD"` but you try to get values from `$_POST['username']` and `$_POST['pass']` - it …

The End.