Posts
 
Reputation
Joined
Last Seen
Ranked #178
Strength to Increase Rep
+8
Strength to Decrease Rep
-2
94% Quality Score
Upvotes Received
212
Posts with Upvotes
159
Upvoting Members
75
Downvotes Received
8
Posts with Downvotes
7
Downvoting Members
7
32 Commented Posts
8 Endorsements
Ranked #233
Ranked #323
~318.39K People Reached
Favorite Tags

267 Posted Topics

Member Avatar for IQBAL_13

I think You need normalize DB-tables for first. create table Pensyarah( IDPensyarah integer not null primary key auto_increment , IDUser varchar(50) not null , NamaPensyarah varchar(100) not null , Email varchar(50) not null , NoTel varchar(11) not null ); create table Kursus( IDKursus integer not null primary key auto_increment , …

Member Avatar for Dani
0
149
Member Avatar for Rico_2

Use recursive printing e.g. <?php function print_recursive($list){ echo '<ul>'; foreach($list as $item){ echo '<li id="'.$item['id'].'">'.$item['text']; if( isset($item['children']) ){ print_recursive($item['children']); } echo '</li>'; } echo '</ul>'; } print_recursive($list); ?>

Member Avatar for AndrisP
0
144
Member Avatar for Ant_426
Member Avatar for Ant_426
0
497
Member Avatar for larry29936
Member Avatar for TimTheCoder

I think your mistake is comparing string and number ![SQLite.png](https://static.daniweb.com/attachments/4/7066cc9b4c0eb84ab280812562ca5270.png) You should be use `cast(strftime('%Y', HireDate) as number)<2003`

Member Avatar for TimTheCoder
0
81
Member Avatar for Irfan_9
Member Avatar for AndrisP
0
27
Member Avatar for prod.

For first check your MySQL version select version() from dual; Because all `"mysql_..."` in current (MySQL 8.0.) is deprecated - probably you should be use `"mysqli_..."` instead

Member Avatar for AndrisP
0
516
Member Avatar for skymhine

1. I recomend use prepared statement instead of directly put user input data to SQL query. 2. Use [SEND_LONG_DATA](https://www.php.net/manual/en/mysqli-stmt.send-long-data.php) to store blob into database.

Member Avatar for Dani
0
101
Member Avatar for ChrisJ

if you want to denormalize SQL table for search then you think wrong

Member Avatar for AndrisP
0
76
Member Avatar for vinothini_2021

Use CSS e.g. input[type="button"][value="one"] { background: blue; } input[type="button"][value="two"] { background: red; }

Member Avatar for AndrisP
0
46
Member Avatar for ramyaamirtham99

Radio buttons let a user select ONLY ONE of a limited number of choices Use same attribute "name" but array of values use as attribute "value" e.g. var div = document.createElement('div'); div.setAttribute('id','my_div'); document.body.appendChild(div); function addradio(){ const names=["abi","sam","tom"]; names.forEach( function(curr){ document.getElementById("my_div").innerHTML+='<br/>' +'<input type="radio" id="my_'+curr+'" name="names" value="'+curr+'" />' +'<label for="my_'+curr+'">'+curr+'</label>'; } ); …

Member Avatar for AndrisP
0
68
Member Avatar for radhika_3

Your mistake is comma after `$_POST['JENIS_PERMINTAAN']`. If you want to handle as array `$_POST['JENIS_PERMINTAAN'], reverse_tanggal($_POST['TGL_PERMINTAAN'])` then include it in square brackets foreach([$_POST['JENIS_PERMINTAAN'], reverse_tanggal($_POST['TGL_PERMINTAAN'])] as $idx=>$val){

Member Avatar for AndrisP
0
59
Member Avatar for minoesje

Manage date in SQL query: $id = $_GET['id']; $sql = "UPDATE apparatuur SET inlever_datum = date(current_date()+7), uitleen_datum = NOW() WHERE id= ? "; $stmt = $conn->prepare($sql); $stmt->bind_param('i', $id); $status = $stmt->execute();

Member Avatar for AndrisP
0
65
Member Avatar for soniyabis
Member Avatar for AndrisP
0
138
Member Avatar for Paulo_9

and another question - why you do not use `pathinfo($file,PATHINFO_EXTENSION)` insead of `substr($file, strrpos($file, '.') + 1)` in line 4?

Member Avatar for AndrisP
1
301
Member Avatar for Gabriel9999

Do not need write script for this. Actually its a single line command e.g. You have directory `dir1` which contains multiple files and `dir2` which is target to copy `cp dir1/* dir2/` copy all files

Member Avatar for AndrisP
2
402
Member Avatar for litlemaster

@klaus.veliu - Safe version is $users=array("Vito","Joey","Vinny"); $prep=str_pad("?",count($users)*2-1,",?"); // produce string '?,?,?' $sql = "SELECT * FROM `users` WHERE `name` in (".$prep.")"; $stmt = $db->prepare($sql); $stmt->execute($users); $result = $stmt->fetchAll(PDO::FETCH_ASSOC); or $users=array("Vito","Joey","Vinny"); $sql = "SELECT * FROM `users` WHERE FIND_IN_SET(`name`,?)"; $stmt = $db->prepare($sql); $stmt->execute([implode(",",$users)]); $result = $stmt->fetchAll(PDO::FETCH_ASSOC);

Member Avatar for mukesh_20
0
37K
Member Avatar for larry29936

Don't need `declare` - select values direct to fields DELIMITER // CREATE TRIGGER download_ins BEFORE INSERT ON download FOR EACH ROW begin set new.ip_address = inet_aton(new.`ADDRESS`); set new.vrefer=(select id from `ip_lookup` where inet_aton(new.`ADDRESS`) between ip_lookup.start and ip_lookup.end limit 1 ); END; // DELIMITER ;

Member Avatar for larry29936
1
258
Member Avatar for Dani

Actually it do not affect any changes - `on duplicate update ...` in your example supress error message. The same can be achieved with `insert ignore into table ...`

Member Avatar for Dani
0
1K
Member Avatar for nishita_1

I recommend use `join` instead of `subquery` if possible because join works faster. I think you have another table e.g. `products` which contains all product id. Select `product_id` from products and `left join` sale and purchase. Where clause exclude null values e.g. select p.product_id ,sum(s.quantity) sale ,sum(c.quantity) purchase from products …

Member Avatar for drmrkrch
0
1K
Member Avatar for larry29936

Get value from array by key `$temp['IP_ADDRESS']` but use of `between` in your code is wrong - should be convert by `INET_ATON`

Member Avatar for larry29936
0
471
Member Avatar for Aman_24

It's a very simple in single row: string='India is a democracy' print (' '.join([word for word in reversed(string.split(' '))]))

Member Avatar for AndrisP
0
594
Member Avatar for Bhavini_2

MySQL: select date_format(now(), '%d-%m-%Y'); PostgreSQL: select to_char(now(), 'dd-mm-yyyy'); OracleSQL: select to_char(sysdate, 'dd-mm-yyyy') from dual; Clause `from dual` in Oracle is required, in MySQL is optional, in PG SQL not usable - raise error

Member Avatar for anand9796
0
302
Member Avatar for FarrisFahad
Member Avatar for lyounkins

You can add to CSS .PaperApplication { visibility: hidden; } for set element with class PaperApplication hidden by default. After click radio button function change it to visible.

Member Avatar for AndrisP
0
284
Member Avatar for kamilacbe

In JS months numbered from 0 to 11. Actually 11 is december. You can write simple function function addMonths(d,n){ var dt=new Date(d.getTime()); dt.setMonth(dt.getMonth()+n); return dt; } and then e.g. var d=new Date(); // current date var d1=addMonths(d,1); var d2=addMonths(d,2); var d3=addMonths(d,3); convert month number to 1-12 var n1=d1.getMonth()+1; var n2=d2.getMonth()+1; …

Member Avatar for Airshow
0
2K
Member Avatar for Joedanica

In your example "0" is terminator but "0" allways incrases "even". Check `if(entNum==0){ break; }` after scanf. More convenient is binary compare to 1 for test even and odd in my opinion e.g. lines 15-22 you can replace to one line: `entNum & 1 ? odd++ : even++ ;` variable …

Member Avatar for Reverend Jim
0
291
Member Avatar for herdhemhola
Member Avatar for jack98

In your HTML code `<table>` not opened, table row `<tr>` not opened, invalid `<input>` tag without `>` - it should be something like if($result->num_rows > 0){ echo '<table>'; while ($row6 = $result->fetch_assoc()){ //table code// echo '<tr>'; echo '<td><input type="checkbox" name="check[]" value="'.$cato.'" /></td>'; echo '</tr>'; } echo '</table>'; } PHP code …

Member Avatar for AndrisP
0
1K
Member Avatar for divyang_patel

Use backticks instead of apostrophes `attendence` AS 'type' ,`in_address` AS 'address_in' ,`out_address` AS 'address_out'

Member Avatar for AndrisP
0
338
Member Avatar for Cedo

Inputs should be inside form. Inputs with similar names should be pass as array. <input type="checkbox" name="name[]" value="<?php echo $name;?>" /><?php echo $name;?>

Member Avatar for AndrisP
1
525
Member Avatar for cwriter77

List of enabled/disabled srvices `~$ systemctl list-unit-files` Script for enable: #!/bin/bash for i in $* do sudo systemctl enable $i done Call above script with passing multiple arguments or call below script with hardcoded services #!/bin/bash for i in eg_service_1 eg_service_2 eg_service_3 do sudo systemctl enable $i done

Member Avatar for AndrisP
0
409
Member Avatar for CreatorZeus

HTML syntax is broken - line 103 `<div`, line 122 opened `<div>` is closed inside another table cell in line 144

Member Avatar for AndrisP
0
499
Member Avatar for anon0441

Must be use [contentWindow or contentDocument](https://www.w3schools.com/jsref/prop_frame_contentwindow.asp)

Member Avatar for AndrisP
0
331
Member Avatar for milan.sabic

This looks good. Show PHP code where you try to set variables to global or session.

Member Avatar for AndrisP
0
689
Member Avatar for keaikitse

1. Uncripted password never store in to the database 2. Use prepared statement instead of direct passing variables to SQL query 3. Then write a question

Member Avatar for Ray Paseur
0
3K
Member Avatar for ammysh
Member Avatar for phphp

select min(`Date`), `Qty` from `tablename` group by extract(hour from `Date`);

Member Avatar for AndrisP
0
289
Member Avatar for bprosic

Actually you can create multi level categories in single table if data structures are similar with references to self table . Second table contains references many-to-many e.g. create table `categories`( `id` int primary key not null auto_increment ,`title` varchar(30) not null ,`description` varchar(300) not null ,`op_datetime` timestamp default current_timestamp on …

Member Avatar for AndrisP
0
669
Member Avatar for Zahi_1

Use $id = filter_input(INPUT_GET, 'id', FILTER_VALIDATE_INT); if($id !== NULL){ ... } instead of lines 4,5,6, use prepared statement intead of direct pass variable (line 7) to prevent from SQL injection. White space in GET parameter can be damage your variable `<a href="newtestpage.php?id=<?php echo $post['C_ID'];?> #editEmployeeModal" class="edit" id ="<?php echo $post['C_ID'];?>" …

Member Avatar for AndrisP
0
371
Member Avatar for JACK_49

Directory is created? Add to line 5 "or die('Cannot create directory')" eg `mkdir($dirname) or die ("Cannot create directory");` check web server error log file. Probably permission denied.

Member Avatar for AndrisP
0
273
Member Avatar for JustinRunyon

replace XSLT to: <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > <xsl:strip-space elements="*"/> <xsl:output method="xml" indent="yes" encoding="utf-8"/> <xsl:template match="/"> <doc xml:lang="de"> <xsl:comment>Termine</xsl:comment> <p class="T_termine_fussball"> <xsl:variable name="spieldatum" /> <xsl:for-each select="tabelle/vorschaupaarungen/vorschaupaarung"> <xsl:if test="spieldatum != preceding-sibling::vorschaupaarung[1]/spieldatum"> <span class="C_termin"> <xsl:value-of select="normalize-space(substring(spieldatum,4,7))"/> </span> </xsl:if> <span class="C_paarung"> <xsl:value-of select="heimmannschaft"/> - <xsl:value-of select="gastmannschaft"/> </span> </xsl:for-each> </p> </doc> </xsl:template> </xsl:stylesheet>

Member Avatar for AndrisP
0
308
Member Avatar for Ashking_1

Include database (line 9) should be outside of object `User` because in line 11 you define reference to db connection which is lost after comlete user construct

Member Avatar for AndrisP
0
335
Member Avatar for Talib_1

Use prepared statement instead of direct insert to prevent from SQL injection! Naming checkboxes with empty quadratic brackets e.g. <input type="checkbox" name="s_id[]" value="1" /> <input type="checkbox" name="s_id[]" value="2" /> <input type="checkbox" name="s_id[]" value="3" /> PHP $s_id=filter_input(INPUT_POST,'s_id',FILTER_VALIDATE_INT,FILTER_REQUIRE_ARRAY); $date=filter_input(INPUT_POST,'datee'); $time=filter_input(INPUT_POST,'time'); $stmt = mysqli_prepare($con, "INSERT INTO table(id,s_id,date,time) VALUES(null,?,?,?)"); mysqli_stmt_bind_param($stmt, "iss", $id,$d,$t); $d=$date; $t=$time; …

Member Avatar for AndrisP
0
1K
Member Avatar for aspundir

Look to the console: "as" is not defined (line 29 and 95), function in parameter "ta" not used inside function.

Member Avatar for AndrisP
0
193
Member Avatar for Eric_28

Table name and column name in MySQL query string should be without quotes or you can use backticks.

Member Avatar for AndrisP
0
502
Member Avatar for Ahmed_109

Use prepared statement instead of direct insert to prevent from SQL injection! You try to save into table `saveoffice`? To save into tables `office1` and `office2` try something like this: <?php $link = mysqli_connect("localhost", "username", "password", "database"); $result = []; for($i=1; $i<=2; $i++){ $office = filter_input(INPUT_POST, 'offices'.$i); $result[$i] = 0; …

Member Avatar for AndrisP
0
1K
Member Avatar for tony75

It is not right answer - redundant white space after hiphens right is: `(\d{3}[-]){2}\d{5}` (three digits with followed hiphens) {two times} and then five digits

Member Avatar for Reverend Jim
0
446
Member Avatar for Jon_7

I see you are using `<input type="date" />` - do not need set date by jQuery, just add value (format `YYYY-MM-DD`), e.g. `<input type="date" value="2018-09-24" />`

Member Avatar for AndrisP
0
20K
Member Avatar for PM312

Read tech spec abot your graphic card - max count of monitors, sum of max pixel-width and sum of max pixel-height

Member Avatar for rproffitt
0
1K

The End.