267 Posted Topics
Re: It's a margin of <h2 class="utopic-flowers"> <span>u</span>topic <span>f</span>lowers </h2> try to replace e.g. <b class="utopic-flowers"> <span>u</span>topic <span>f</span>lowers </b> and you will see that the extra margin of input element disappears | |
Re: Edit `__constructor` to `__construct` and `__destructor` to `__destruct`. If you define function with required argument then you cant initialize it without argument e.g. Constructor with required argument: function __construct($person_name){ echo "Initialize class"; $this->set_name($person_name); } Same contructor but argument is optional (set default value): function __construct($person_name=NULL){ echo "Initialize class"; if($person_name !== … | |
Re: Your mistake is here `caption='Harry' s SuperMart '` | |
Re: Try to rename JS function to different from select element ID. And a few more tips: if you declare XHTML document then always close tags. The XHTML syntax does not allow unclosed `<br>` or `<input type="checkbox" id="event_ltm" name="event_ltm[]" value="1">` etc elements Good practice defines an object that is once declared … | |
Re: Use `send_long_data`http://php.net/manual/en/mysqli-stmt.send-long-data.php for blob upload in to the DB and use prepared statement to prevent from SQL injection. | |
Re: Show your function `getListed` | |
Re: Try something like this: create or REPLACE procedure modelzz( VAR_MODEL IN MODELS.NAME_MODEL%TYPE ) as cursor c_automobiles is SELECT a.A_PRICE FROM AUTOMOBILES a join MODELS m on a.MODELS_ID_MODEL=m.ID_MODEL where m.NAME_MODEL=VAR_MODEl; VAR_PRICE AUTOMOBILES.A_PRICE%TYPE; begin open c_automobiles; loop fetch c_automobiles into VAR_PRICE; exit when c_automobiles%notfound; dbms_output.put_line( VAR_MODEL||'''s price is : '||VAR_PRICE ); end … | |
Re: Outside of main template define two variables and another template: <xsl:variable name="quot">"</xsl:variable> <xsl:variable name="doublequot">""</xsl:variable> <xsl:template name="string-replace-all"> <xsl:param name="text" /> <xsl:choose> <xsl:when test="contains($text, $quot)"> <xsl:value-of select="substring-before($text,$quot)" /> <xsl:value-of select="$doublequot" /> <xsl:call-template name="string-replace-all"> <xsl:with-param name="text" select="substring-after($text,$quot)" /> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:value-of select="$text" /> </xsl:otherwise> </xsl:choose> </xsl:template> and lines 157-161 in XSLT file … | |
Re: Convert to raw after encrypt and save as raw data in to the db. | |
Re: 1. Do not need make new connection in line 30 - use existing 2. If you want to post multiple "room" define field name as array `<select name="room[]">` or `<select name="room[$i]">` 3. Set option value e.g. `<option value="$rname">$rname</option>` 4. I recommend you use `filter_input(INPUT_POST, 'room')` instead of `$_POST['room']` e.g. $room … | |
Re: Do not include any outside of `<head></head>` and `<body></body>` check line 20 in your code sample | |
| |
Re: Your method are wrong for BLOBs - read [this](http://php.net/manual/en/mysqli-stmt.send-long-data.php) manual | |
Re: Select also ID of country. <tr> <td>Country Name</td> <td> <select name="countryID"> <?php $conn = oci_connect("username", "pswrd", "db"); $sql = 'SELECT id,name FROM country'; $stid = oci_parse($conn, $sql); $success = oci_execute($stid); while ($row = oci_fetch_array($stid, OCI_RETURN_NULLS+OCI_ASSOC)) { echo "<option value=\"" . $row['ID'] . "\">" . $row['NAME'] . "</option>"; } ?> | |
Re: Use of `&` inside REQUEST variable is not good idea. I suggest replace to `and` but if you realy want to use it then use as `&` | |
Re: I suggest to you use `filter_input()` method instead of `$_GET['page']` and set min, max, default values: <?php $perPage = 6; $stmt = $conn->prepare("select count(*) from tbl"); $stmt->execute(); $productCount = $stmt->fetchColumn(); $totalPages = ceil($productCount/$perPage)-1; $options = array('options'=> array('min'=>0,'max'=>$totalPages,'default'=>0) ); $page = filter_input(INPUT_GET, 'page', FILTER_VALIDATE_INT, $options); ?> Use 0 for first page … | |
Re: Method `oci_fetch_array()` will return all rows. Change to `oci_fetch_assoc()` | |
Re: Actually results is numbers divisible by 12. Another way to find - check last 4 bits. It should be 1100 | |
Re: Add backslashes before apostrophes `onclick="window.location.href='route('pemesanan')';"` if you have to pass string `pemesanan` or add plus `onclick="window.location.href='route('+pemesanan+')';"` if "pemesanan" is javascript (number or object) variable name or put both if it string variable name `onclick="window.location.href='route(''+pemesanan+'')';"` | |
Re: You are set 25 symbols (+9 white space) width for each column - maybe output window is not so large | |
Re: Would you think something like this? <!DOCTYPE html> <head> <script type="text/javascript"> function donation(){ this.dnts = [1,2,3,4,5,6,7,8,9,10]; this.cost = [50,500,5000]; this.unit = ['hours', 'days', 'months']; this.selected = [0,0]; this.init = function(){ this.dn = document.getElementById('dn'); this.sm = document.getElementById('sm'); this.rs = document.getElementById('rs'); this.dn.innerHTML=""; for(var i in this.dnts){ this.dn.innerHTML += '<option>'+(this.dnts[i])+'</option>'; } this.sm.innerHTML=""; for(var … | |
Is the method in MySQL to set in SQL script dynamic log file name? e.g in Oracle PL/SQL set define on column sdate new_value sdate select to_char(sysdate,'YYYY.MM.DD_HH.MI') sdate from dual; spool 'logs/install_&sdate..log'; e.g. in PG/SQL \o ./logs/install_`date +"%Y-%m-%d_%H%M"`.log but I cant find similar in MySQL \T ?????? | |
Re: It should work similar. But column name `date` is not good - add prefix or use it inside backticks | |
Re: Yes all good - unseparated output. Add new lines after each output. cin >> x; cout << x++ << "\n"; cout << ++x << "\n"; cout << x << "\n"; | |
Re: Line 2 replace `_init__` to `__init__` | |
Re: I think you need use `left join` and make all calculations in SQL. Something like this: SELECT j.id ,j.journal_date ,j.balance ,COUNT(p.projection) -- calculate here FROM journals j LEFT JOIN projects p on j.user_id = p.user_id WHERE j.user_id = '$user_id' ORDER BY j.journal_date ASC ![]() | |
Re: when you set `header("Content-Type:text/plain");` or use it inside pre `echo '<pre>'.$content.'</pre>`;` then it should be work fine ![]() | |
Re: 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. | |
Re: Read this https://css-tricks.com/snippets/svg/curved-text-along-path/ about SVG textPath | |
Re: 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 substr(`ord_column`, 1, 2)='A ' then substr(`ord_column`, 3) when substr(`ord_column`, 1, 4)='The ' then substr(`ord_column`, 5) else `ord_column` end | |
Re: Why don't you use the`loadXML` function and then handle it through the DOM object? http://php.net/manual/en/domdocument.loadxml.php | |
Re: 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 !== NULL){ $sql = .... } if(isset($_POST['add_submit']) && $brand !== NULL){ $sql = .... } and bind variables after prepare SQL … | |
Re: 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) | |
Re: 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` and I recommend use $uid = filter_input(INPUT_POST, 'uid', FILTER_VALIDATE_INT); instead of $uid = false; if(isset($_POST['uid'])){ $uid = $_POST['uid']; } function … | |
Re: Because `$result` is array - do not concatenate as a string | |
Re: Where from do you get values for update? Its manual input or other? | |
Re: <?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" alt="\\2" /> </a>', $content); header("Content-type:text/plain;charset=utf-8"); print_r($content); ?> | |
Re: `$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> <button class="c-button" name='bid'>Bid Now!</button> </div><?php endwhile; ?> | |
Re: select * from some_table where `last order date` < date_sub(now(), interval 3 month) | |
Re: Where you define variables `$textfile_occupation, $institution, $UserLogin` ? Where you execute `$query_insert` ? | |
Re: 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 ![]() | |
Re: 1. Password should be crypted! 2. In to the lines 2 and 3 variables defined - ok. But do not need set default values because if not set both post variables then in lines 13-17 values not replaced! 3. Lines 26 and 27 you again try to get values from … | |
Re: Maybe browser show cached images. Try generate different file names to output image | |
Re: Set unique key constraint `image` and then insert/update in one SQL e.g. `prepare("Insert into flood_light (Name, Brand, Quantity, Detail, Unit, Color, Material, Image) values(?,?,?,?,?,?,?,?) on duplicate key update set Name = VALUES(Name), Brand = VALUES(Brand), Quantity = VALUES(Quantity), Detail = VALUES(Detail), Unit = VALUES(Unit) Color = VALUES(Color), Material = VALUES(Material)"); … ![]() | |
Re: line 13 should be `print(self.question)` and similar mistake in the line 22 | |
Re: Invalid column name `phone number`. You can use space separated column name inside bockqoutes e.g. `CREATE TABLE BUILDING(bname VarChar2(30) PRIMARY KEY, address VarChar2(30), "phone number" Number(15));` | |
Re: About `allow` and `deny` read this https://httpd.apache.org/docs/2.2/mod/mod_authz_host.html | |
Re: It's a dual boot PC? If yes maybe Windows system is sleep or hybrid sleep not succesfully shut down. | |
Re: 1. Password should be crypted! 2. Use `filter_input()` function e.g. `$username = filter_input(INPUT_POST, "username");` 3. Check `if($username !== NULL && $password !== NULL){ ... }` before query 4. Do not put user input parameters directly to SQL query! - Use prepared statement: `prepare()`, `bind_param()`, `execute()` 5. For precise string comparison … |
The End.