267 Posted Topics

Member Avatar for Niels_1

and don't put php variables directly in to the SQL query use bind_param instead http://php.net/manual/en/mysqli-stmt.prepare.php

Member Avatar for AndrisP
0
144
Member Avatar for Siberian

SVG example ("width" and "height" similar to "viewBox"): <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="150" height="150" viewBox="0 0 150 150"> <rect x="0" y="0" width="150" height="150" fill="#FFFFAA" opacity="1" /> <circle r="20" cx="75" cy="75" fill="none" stroke="#000088" stroke-width="3" /> <rect x="60" y="60" width="30" height="30" fill="#888888" opacity="1" …

Member Avatar for AndrisP
0
278
Member Avatar for nitin1

In your example you trying send to server two variables by same name. I think more convenient is array of checkboxes with binary step values e.g. <form action="" method="post"> <input type="checkbox" id="status_1" name="status[]" value="1" /> <input type="checkbox" id="status_2" name="status[]" value="2" /> <input type="checkbox" id="status_3" name="status[]" value="4" /> <input type="submit" /> …

Member Avatar for AndrisP
1
512
Member Avatar for toomutch

For first check your patch cable - connection 10mbps or 100mbps used 2 pairs only (4pin) but 1000mbps used all 4 pairs (8pin) and very important that all eight would be in the correct order!

Member Avatar for toomutch
0
287
Member Avatar for Dipti_1

If you replace to print recursive then you can see structure of the generated XML object <!DOCTYPE html> <html> <body> <pre> <?php $xml=simplexml_load_file("demo.xml") or die("Error: Cannot create object"); print_r($xml); ?> </pre> </body> </html> do with it what you want e.g. "foreach"

Member Avatar for AndrisP
0
241
Member Avatar for Shantel
Member Avatar for AndrisP
0
92
Member Avatar for iqlas

You can create stored procedure like this: DELIMITER $$ DROP PROCEDURE IF EXISTS `dinamic_update`$$ CREATE PROCEDURE `dinamic_update`( IN p_lang_name VARCHAR(30), IN p_ent_id INT, IN p_new_value VARCHAR(30) ) BEGIN SELECT `lang_code` INTO @v_lang_code FROM `tbl_lang` WHERE `lang_name` = p_lang_name; SET @sql_text = CONCAT('UPDATE `tbl_unicode` SET ' , @v_lang_code, ' = '', …

Member Avatar for AndrisP
0
2K
Member Avatar for joshl_1995

I think you need RIGHT JOIN something like this: DROP TABLE IF EXISTS `products`; CREATE TABLE `products`( `prod_id` INT PRIMARY KEY ,`prod_name` VARCHAR(30) ,`prod_descr` VARCHAR(90) ,`prod_price` DECIMAL(7,2) ,`prod_stock` INT ,`prod_date` DATE ); DROP TABLE IF EXISTS `wish_list`; CREATE TABLE `wish_list`( `wish_id` INT PRIMARY KEY ,`wish_account` INT ,`wish_item_id` INT ,`wish_date` DATE …

Member Avatar for joshl_1995
0
291
Member Avatar for TObannion

1. Function "indexOf()" returns number not boolean. If not found "-1" else position "0" or higher 2. Search string is argument: "string".indexOf("ring") return "2", but "ring".indexOf("string") return "-1"

Member Avatar for mblan180131
0
184
Member Avatar for sashiksu

I think `NULLIF(settlement, 0) IS NULL` is better than `settlement < 0.01 or settlement IS NULL` Try this: SELECT * FROM settlement WHERE NULLIF(settlement, 0) IS NULL

Member Avatar for AndrisP
0
364
Member Avatar for Brian_17

CREATE TABLE `test_table`( `id` INT NOT NULL AUTO_INCREMENT, `data` DATE, `ip` VARCHAR(30), PRIMARY KEY (`id`) ); DELIMITER $$ DROP PROCEDURE IF EXISTS insert_data; $$ CREATE PROCEDURE insert_data(IN p_cur INT, IN p_max INT) BEGIN TRUNCATE TABLE `test_table`; START TRANSACTION; WHILE p_cur <= p_max do INSERT INTO `test_table`(`id`, `data`,`ip`) VALUES (p_cur, NOW(), …

Member Avatar for AndrisP
0
4K
Member Avatar for Podu

<?php $selectedSizes = ( isset($_POST[size]) ? implode(",", $_POST[size]) : "" ); $sql = "SELECT * FROM `your_table_name` t WHERE FIND_IN_SET(t.`size_field`, ?)"; // then bind param $selectedSizes and execute query ?>

Member Avatar for AndrisP
0
609
Member Avatar for SpottyBlue

In HTML5 you can validate this without JS. If you change input type text to input type tel and input type email. Use attribute pattern for vaidate input type tel e.g. <input type="tel" pattern="^[0-9]{8}$" /> Input type email you can use without pattern

Member Avatar for AndrisP
0
360
Member Avatar for Reem50

You can change <form enctype='multipart/form-data' id = "myform"> <input type='submit' value='Basic search' onclick="i2b2.BLAST.jsFunction()"> to <form enctype="multipart/form-data" id="myform" onsubmit="i2b2.BLAST.jsFunction(); return false;"> <input type="submit" value="Basic search" > then your function call when user press enter on any input field (same as submit button)

Member Avatar for AndrisP
0
275
Member Avatar for Siberian
Member Avatar for Siberian
0
158
Member Avatar for janicemurby

if you want insert: INSERT INTO tablename (col1, col2, col3) VALUES (?,?,?) if you want update table: UPDATE tablename SET col1 = ? , col2 = ? , col3 = ? WHERE id = ? your example contain illegal mix of sql commands. And do not directly put variables into …

Member Avatar for rubberman
0
13K
Member Avatar for wikit

You can use RLIKE instead: SELECT 'sun' RLIKE '^sun[^shine]*$'; SELECT 'sunshine' RLIKE '^sun[^shine]*$'; or use word boundaries: SELECT 'long text contain sun and other words' RLIKE '[[:<:]]sun[[:>:]]'; SELECT 'long text contain sunshine and other words' RLIKE '[[:<:]]sun[[:>:]]';

Member Avatar for drjohn
0
208
Member Avatar for geysa
Member Avatar for stultuske
0
376
Member Avatar for Hermelix
Member Avatar for LibraryCode
Member Avatar for yaginuk

$transmission_type = ( isset($_POST['transmissionTypeInput']) && $_POST['transmissionTypeInput']=='automatic' ? 'automatic' : 'manual' );

Member Avatar for yaginuk
0
188
Member Avatar for Praise92

Something like this: SELECT d.DealerShipID, d.DealerShipName, u.UserID, u.UserName, u.Email, u.Phoneand FROM DealerShip d LEFT JOIN Users u ON u.DealerShipID = d.DealerShipID WHERE d.DealerShipName IN('a', 'b', 'c');

Member Avatar for Praise92
0
237
Member Avatar for Dee Wa Kar
Member Avatar for AndrisP
0
110
Member Avatar for UK-1991

You mean mysqli_insert_id() ? http://php.net/manual/en/mysqli.insert-id.php

Member Avatar for UK-1991
0
200
Member Avatar for Firmace

1) <li> inside <b> isn't ok - replace to <b> inside <li> instead 2) id need unique but in your example any <li> has same id if you want multiple selected <li> use class instead of id and replace CSS `#menu1 li#selected` to `#menu1 li.selected`

Member Avatar for diafol
0
1K
Member Avatar for AntonyRayan

<select name="dropdown"> <option value="">--Select--</option> <?php $a=mysql_query("Select * from student whre status='0'")or die(mysql_error()); $b=mysql_num_rows($a); if($b >0) { while($row=mysql_fetch_array($a)) { $selected = ( $row['st_id']=="id_for_compare" ? ' selected' : '' ); echo ' <option value="'.$row['st_id'].'"'.$selected.'>'.$row['name'].'</option>'; } } ?> </select> or use $row['name'] if you want compare rowname

Member Avatar for Gideon_1
0
13K
Member Avatar for Elmar_2

set it as variable (PHP output), e.g: <root somevariable="<?php echo 'somevalue'; ?>"> </root> put in to the XSLT file: <div class='rating'> <xsl:attribute name="style"> <xsl:value-of select="//@somevariable"/> </xsl:attribute> </div>

Member Avatar for AndrisP
0
106
Member Avatar for Rraj
Member Avatar for sing1006

Line 4 replace: `movielist.appendChild(newNode);` or if you want to put new node after resource to copy then check if child.nextSibling exist then `movielist.insertBefore(newNode, child.nextSibling);` otherwise `movielist.appendChild(newNode);`

Member Avatar for sing1006
0
333
Member Avatar for Learner010
Member Avatar for Markland
7
708
Member Avatar for naui95
Member Avatar for Reverend Jim
0
202
Member Avatar for <M/>

Latvian is my main language. Russian perfectly. Little English, little German.

Member Avatar for iamthwee
0
500
Member Avatar for Farrukh saleem
Member Avatar for rose_2

`for(i=0;i<=10;i++)` it's 11 iterations use `for(i=1;i<=10;i++)` or `for(i=0;i<10;i++)`

Member Avatar for rose_2
0
140
Member Avatar for markdean1989

If you define function after call it, then declare it before e.g. put line `int func_compare(int x, int y);` before main()

Member Avatar for markdean1989
0
324
Member Avatar for davy_yg
Re: Form

It seems that your submit clickable controlled by javascript

Member Avatar for broj1
0
258
Member Avatar for chubbyy.putto

You can use `<input type="number" min="0" />` instead of disable submit button in HTML5.

Member Avatar for AndrisP
0
112
Member Avatar for Transcendent

You read value from form input in to the JavaScript lines 7 and 8 and after you try read value from value in to the lines 12 and 13

Member Avatar for AndrisP
0
219
Member Avatar for engrjd91

Delete space after equal sign `action= "<?php echo $current_page; ?>"` replace to `action="<?php echo $current_page; ?>"` and never use equal sign for compare username and password in the MySQL! Try this test case: SELECT 'ABC' = 'abc','ĀBČ' = 'abc','ābč' = 'abc', 'ABC' LIKE 'abc', 'ĀBČ' LIKE 'abc', 'ābč' LIKE 'abc', …

Member Avatar for toxicandy
0
231
Member Avatar for cambalinho
Member Avatar for SumTingWong59

#include <iostream> #include <iomanip> using namespace std; void piramid(int count){ setfill(" "); for(int i=0; i<count; i++){ cout << setw(count-i) << (i+1); for(int j=i; j>0; j--){ cout << j; } for(int j=1; j<=i; j++){ cout << (j+1); } cout << "\n"; } cout << "\n"; } int main(){ piramid(1); piramid(2); piramid(4); …

Member Avatar for AndrisP
0
181
Member Avatar for Abdu Rahman

in example: #include <iostream> #include <stdio.h> void examplefunction(int a, int b, char c){ switch (c){ case '+': printf("%d + %d = %d\n", a,b,a+b); break; case '-': printf("%d - %d = %d\n", a,b,a-b); break; case '*': printf("%d * %d = %d\n", a,b,a*b); break; case '/': printf("%d / %d = %d\n", a,b,a/b); …

Member Avatar for AndrisP
0
102
Member Avatar for Sumith Asanka

In HTML5 you can use attribute "required" to `<input type="text" required="required" />` and `<input type="password" required="required" />` instead of your js function

Member Avatar for AndrisP
0
341
Member Avatar for shahera.arafat

void is no returns but can change input params e.g. #include <iostream> #include <stdio.h> void myfunc(int &a, int &b, int &c){ a += 1; b -= 2; c = a+b; return; } int main(){ int a=5,b=6,c=7; // print before myfunc() printf("a=%d b=%d c=%d \n", a,b,c); myfunc(a, b, c); // print …

Member Avatar for mike_2000_17
0
195
Member Avatar for Yorkiebar14
Member Avatar for lewashby

if you want to set default values to (0,0) then replace lines 9 and 10 to this Point(int new_x=0, int new_y=0) { set(new_x, new_y); }

Member Avatar for AndrisP
0
127
Member Avatar for moaz.amin.37

Charcodes of capital letters is 65-90. Replace line 29 to `if(int(str[i])>=65 && int(str[i])<=90)`

Member Avatar for Sarkurd
0
656
Member Avatar for Mike_H

If type of id_key is INTEGER then try set value without apostrophes $query="UPDATE va SET id_key=$id"; or $query="UPDATE va SET id_key=".$id;

Member Avatar for Mike_H
0
196
Member Avatar for Angle90

Read this topic: [Click Here](https://www.daniweb.com/hardware-and-software/linux-and-unix/threads/466460/converting-web.config-to-.htaccess)

Member Avatar for AndrisP
0
69
Member Avatar for bolfescu

<input type="submit" name="submit" id="submit" class="btn btn-primary" value="Cancella" onclick="confirm('Are you sure?')?window.location='delete_article.php?id=<?=$row['id'];?>':alert('Cancelled');" />

Member Avatar for mattster
0
803

The End.