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
~310.64K People Reached
Favorite Tags
php x 210
mysql x 105
c++ x 35
sql x 22
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
148
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
123
Member Avatar for Ant_426
Member Avatar for Ant_426
0
484
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
69
Member Avatar for Irfan_9
Member Avatar for AndrisP
0
22
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
503
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
97
Member Avatar for ChrisJ

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

Member Avatar for AndrisP
0
74
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
44
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
66
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
56
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
58
Member Avatar for soniyabis
Member Avatar for AndrisP
0
133
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
282
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
386
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
36K
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
250
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
456
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
587
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
297
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
274
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
287
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
335