Sound on/off in typescript

Hello i want to make a button that mutes and unmutes sound in html5 tag.
Here what i have so far. Sadly it doesnt work

.ts

soundOnOff()
{
    let audio = document.getElementById('muteSound') as HTMLMediaElement
    audio.muted = true;
}

html

               <button onclick="enableMute()" type="button">Mute sound</button>
<video id="muteSound" muted="true" playsinline autoplay loop preload="auto">
    <source src="assets/videos/louvre.mp4" type="video/mp4" >
</video>

How to return parameters from different table rows

I have three tables(table, table2,table3). From table1 i want to return three rows: Title, Desc,time,'products' AS type

From table2 i want to return three rows: group_title, group_desc, created,'groups' AS type

From table3 i want to return three rows: name, occupation,birth,'users' AS type

  $sql = "SELECT DISTINCT * 
    FROM
        (SELECT table1.title, table1.desc, table1.time,'products' AS type
        FROM table1 ORDER BY rand() LIMIT 5) AS T
     UNION ALL
        (SELECT table2.group_name,table2.group_desc,table2.created,'groups' AS type
        FROM tabl2 
        JOIN table1 ON table2.id = table1.id 
         ORDER BY rand() LIMIT 5)
    UNION ALL
        (SELECT table3.name,table3.occupation,table3.birth,'users' AS type
        FROM table3
        JOIN  table1 ON table3.id = table1.id
        ORDER BY rand() LIMIT 5)";

am using Ionic to push those three parameters of an Array to the next page so if i use AS and put the same name. I set a parameter AS type that i need so i can work different types. it has to be 'products' AS type for table1, 'groups' AS type for table2, users as type for table3 i want to separate the objects from each table.

It cant use AS the for the rest of the columns because i want to push the original columns
e.g.

 (SELECT table1.title AS title, table1.desc AS desc, table1.time AS time
    FROM table1 ORDER BY rand() LIMIT 5) AS T
 UNION ALL
    (SELECT table2.group_name AS title,table2.group_desc AS desc,table2.created AS time.....

If i do that it displays the object parameters ok e.g. {{item.title}}

but i can not push or navctrl the parameter as title it has to be group_name. I hope i made myself clear.

Item over two divs CSS

Hello i want to create in html and css something like the picture i shared here. An image over two divs. Equally divided through the two divs like the picture here. Any sugestion?

sample.png

Font on background image

Screenshot_2019-03-28.png

Hello i want to show font on an image. Now, the image could be whatever a user uploads- that means white of black background. The font is not looking good. I want to try out something that will look clear on both on dark or light background. I put text shadow on it but the font is not clear. It doesnt looks good. I shared a photo of the problem

MySql GROUP BY on script

Hello i have a problem with a Sql script

SELECT col1_id, col1_name, col2 FROM table GROUP BY ?????

col1_id col1_name col2
A john bear
A john dog
A john cat
A john bear
A john dog
A john cat
A john dog
A john cat
A john bear
A john dog
A john cat
A john bear
A john dog
A john cat
A john dog
A john cat

I want to return all results. It has to return like this: echo col1_id . col1_name (A john) and then col2 (bear,dog, cat)

UNION SQL call original rows

Hello i want to UNION three tables from the same database.

SELECT DISTINCT * 
        FROM
    (SELECT uid as id, name as name, username as username,bio as aboutme, '' as text, 'user' as type, profile_pic as profile_pic, '' as media_pic, '' as group_pic, 'U' as mediatype, '' as image_path FROM users ORDER BY rand() LIMIT 5) AS T

            UNION ALL
            (SELECT group_id as id, group_name as name,'' as username, group_desc as aboutme, '' as text, 'group' as type, '' as profile_pic, '' as media_pic, group_pic as group_pic, 'G' as mediatype, '' as image_path FROM groups ORDER BY rand() LIMIT 5)
        UNION ALL
            (SELECT M.msg_id as id, M.title as name, '' as username,M.description as aboutme, M.message as text, 'media' as type, '' as profile_pic,  M.media_pic as media_pic, '' as group_pic, M.type as mediatype, P.image_path as image_path FROM messages M, user_uploads P ORDER BY rand() LIMIT 5) 

It works but i want to return the original names of the rows for example not id but uid or msg_id or group_id separately. But i still need to UNION Thanks in advance

Angular Html5 video tag

Hello i want to make a video player with HTML5. I t has to have other angular tags and an object inside the <video> tag.
The source code below explkains what i want to do. Is it possible? Any suggestions?

<video controls preload="metadata" style="width:100%; height:100%;z-index: 100">
    <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm" />
    <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4" />
    <source src="//vjs.zencdn.net/v/oceans.ogg" type="video/ogg" />
            <ion-card-content>
                <ion-item (click)="goUser(media.uid_fk)">
                    <ion-avatar item-start >
                        <img src="{{media.profile_pic}}">
                    </ion-avatar>
                    <h2>{{media.username}}</h2>
                    <p>{{media.bio}}</p>
                </ion-item>
                <ion-item>
                    <h2 style="color:#fff" (click)="goMedia(media)">{{media.title}}</h2>      
                    <p>{{media.description}}</p>
                </ion-item>
            </ion-card-content>
        </video>

p.s. it shows the video but not the other inside of it, tags like h2, p ion-item

Ionic – Pass value on another page

I want to pass a value (0 or 1) to another page so i can make an ng if to return a different button. Any help? do i need to pass a parameter from .ts file?

first page.html

<button ion-tem (click)="goUsers()" *ngIf="editors.length == 0" value="0"> <ion-label>
            Add editors
          </ion-label> </button> <button ion-tem (click)="goUsers()" *ngIf="editors.length > 0" value="1"> <ion-label>
            Add more editors
          </ion-label> </button>

second page.html

<button ion-button item-end clear *ngIf="value === '0'"> (click)="addEditor(item)">
                Add as Editor
            </button> <button ion-button item-end clear *ngIf="value ==='1'"> (click)="deleteEditor(item)">
                Already an Editor
            </button>

Make gradient on ion-navbar

Hello i want to make a gradient header on ion-navbar on my ionic 3 project.

home.html
<ion-header><ion-navbar color="primary">

variables.scss

$colors: ( primary: linear-gradient(red, yellow),

This doesnt work. color="primary" works if i put a single color value (e.g. #333)

Any idea how to make it gradient?

CASE WHEN THEN error

Hello i am getting an error on a CASE WHEN THEN syntax on my mySql

         SELECT  DISTINCT u.uid,c.c_id,u.name,u.profile_pic,u.username,u.email,c.time
                FROM conversation c, users u, conversation_reply r
                CASE
                WHEN c.user_one = '99'
                THEN c.user_two = u.uid
                WHEN c.user_two = '99'
                THEN c.user_one= u.uid
                END
                AND (
                c.user_one ='99'
                OR c.user_two ='99'
                ) AND u.status='1' AND c.c_id=r.c_id_fk AND u.uid<>'1'ORDER BY c.time DESC LIMIT 15

 #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'CASE
            WHEN c.user_one = '99'
            THEN c.user_two = u.uid
            WHEN c.user_t' at line 3

Join tables to display activity

Hello i have a database which users make groups or send messages to other registered, in our project, users. So you have messages as M,users as U, groups as G. So you want to show all updates that happen in these tables WHERE (uid - thats the user id column on U table.). All tables have CREATED as datetime column. Users yable is uid on messages is uid_fk and to groups uid_fk. Can i do that with a single statement or do i need to do anything else?

AND OR in the same statement

Hello i have a mysql statement and i want to add more parameters to get different results.

SELECT DISTINCT M.message,F.friend_one,F.friend_two, F.role,U.uid,U.username
    FROM users U,friends F, messages M WHERE ( U.status='1' AND F.friend_one = '88') OR (F.friend_two='88' ) AND F.role='friend'

88 is the users id so i want to show M.message from friends of 88 but not 88 itself
hints:
when one is becoming friend with other friend_one is 88 -for example- and friend_two another user id or vice versa
M table has id of user as a column of course