267 Posted Topics
Re: 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 | |
Re: 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" … | |
Re: 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" /> … | |
Re: 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! | |
Re: 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" | |
Re: Your mistake is concatenate simbol before first string "||" | |
Re: 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, ' = '', … | |
Re: 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 … | |
Re: 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" | |
Re: 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 | |
Re: 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(), … | |
Re: <?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 ?> | |
Re: 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 | |
Re: 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) | |
Re: Replace "getElementByClassName" to "getElementsByClassName" | |
Re: 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 … | |
Re: 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[[:>:]]'; | |
Re: Line 35 return object and then you pass object in next query line 38 | |
Re: Hermelix, mark this thread as solved please | |
Re: Line 12 - wrong syntax comma after last element of array | |
Re: $transmission_type = ( isset($_POST['transmissionTypeInput']) && $_POST['transmissionTypeInput']=='automatic' ? 'automatic' : 'manual' ); | |
Re: 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'); | |
Re: You mean mysqli_insert_id() ? http://php.net/manual/en/mysqli.insert-id.php | |
Re: 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` ![]() | |
Re: <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 | |
Re: 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> | |
Re: Try this https://help.ubuntu.com/community/Boot-Repair | |
Re: 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);` | |
Re: And more compact version: for(int i=0;i<10;std::cout<<i++<<std::endl); | |
Re: Is the data types are identical on columns Pmin, Pmax and Tot? | |
Re: Latvian is my main language. Russian perfectly. Little English, little German. ![]() | |
Re: `for(i=0;i<=10;i++)` it's 11 iterations use `for(i=1;i<=10;i++)` or `for(i=0;i<10;i++)` | |
Re: If you define function after call it, then declare it before e.g. put line `int func_compare(int x, int y);` before main() | |
Re: You can use `<input type="number" min="0" />` instead of disable submit button in HTML5. | |
Re: 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 | |
Re: 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', … | |
Re: #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); … | |
Re: 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); … | |
Re: In HTML5 you can use attribute "required" to `<input type="text" required="required" />` and `<input type="password" required="required" />` instead of your js function | |
Re: 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 … | |
Re: You can use `$.when` http://api.jquery.com/jquery.when/ | |
Re: 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); } | |
Re: Charcodes of capital letters is 65-90. Replace line 29 to `if(int(str[i])>=65 && int(str[i])<=90)` | |
Re: 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; | |
Re: Read this topic: [Click Here](https://www.daniweb.com/hardware-and-software/linux-and-unix/threads/466460/converting-web.config-to-.htaccess) | |
Re: <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');" /> |
The End.