gacoekchip.pokher 0 Newbie Poster

hi all, help me please.

CREATE TABLE `a_table` (
  `id` int(11) NOT NULL,
  `phone` varchar(20) NOT NULL,
  `group` varchar(20) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;
INSERT INTO `a_table` VALUES (1, '111', 'cd');
INSERT INTO `a_table` VALUES (2, '222', 'cd');
INSERT INTO `a_table` VALUES (3, '333', 'cd');
INSERT INTO `a_table` VALUES (4, '444', 'xy');
INSERT INTO `a_table` VALUES (5, '555', 'xy');
INSERT INTO `a_table` VALUES (6, '666', 'xy');

CREATE TABLE `b_table` (
`id` VARCHAR( 11 ) NOT NULL ,
`phone` VARCHAR( 20 ) NOT NULL ,
`message` VARCHAR( 50 ) NOT NULL ,
PRIMARY KEY ( `id` )
) ENGINE = MYISAM ;

I want to SELECT phone FROM a_table WHERE group =xy. and insert a string = "I LOVE YOU" to b_table(phone,message).

condition row of b_table After Query/ Insert is:

----+----------------+----------------------+
id  | phone          |  message             |
----+----------------+----------------------+
1   | 444            |  I LOVE YOU          |
----+----------------+----------------------+
2   | 555            |  I LOVE YOU          |
----+----------------+----------------------+
3   | 666            |  I LOVE YOU          |
----+----------------+----------------------+

how to create query for this problem.
Thank you.

gacoekchip.pokher 0 Newbie Poster

EDIT:

$qr_contacts = "SELECT phone FROM contacts WHERE group_name = '$group'";
gacoekchip.pokher 0 Newbie Poster

@LastMitch:

if $group =="friends";
$phone = '+60111', '+60222', '+60333';

How to insert to outbox table for one click?.

gacoekchip.pokher 0 Newbie Poster

@LastMitch:
Thank you.

gacoekchip.pokher 0 Newbie Poster

Hi All, help me please!.
How to create Query for my project problem.

Mysql table:

CREATE TABLE `outbox` (
`id` INT( 11 ) NOT NULL ,
`phone_number` VARCHAR( 20 ) NOT NULL ,
`text` VARCHAR( 160 ) NOT NULL ,
PRIMARY KEY ( `id` )
) ENGINE = MYISAM ;


CREATE TABLE `contacts` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(25) NOT NULL,
  `phone` varchar(20) NOT NULL,
  `group_name` varchar(20) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=7 ;

INSERT INTO `contacts` VALUES (1, 'jala', '+60111', 'friends');
INSERT INTO `contacts` VALUES (2, 'jali', '+60222', 'friends');
INSERT INTO `contacts` VALUES (3, 'jalu', '+60333', 'friends');
INSERT INTO `contacts` VALUES (4, 'kada', '+60444', 'members');
INSERT INTO `contacts` VALUES (5, 'kadi', '+60555', 'members');
INSERT INTO `contacts` VALUES (6, 'kadu', '+60666', 'members');

Form:

<html>
<body>
<h1>Form Send SMS Message</h1>

<form method="post" action="insert.php">
<table>
  <tr><td>Send To</td><td>:</td><td>
       <select name="group">
       <option selected>Select Phone Group</option>
         <option value="members">Members Group</option>
         <option value="friends">Friends Group</option>
       </select>
       </td><tr>   
  </tr>
  <tr><td>Message</td><td>:</td><td><textarea name="message" rows="10" cols="20"></textarea></td></tr>  
</table>
<input type="submit" name="submit" value="submit">
</form>
</body>
</html>

proses Form:

<?php
include ("koneksi.php");
$con = mysql_connect($servername,$username ,$password);
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("smsd");

        $group=$_POST['group'];
        $message=$_POST['message'];

    $qr_contacts = "SELECT phone FROM contacts WHERE group_name = $group";
    $rs_contacts = mysql_query($qr_contacts);
    while($data = mysql_fetch_array($rs_contacts))
        {
        $id= $data['id'];
        $phone= $data['phone'];

        // I Want insert to outbox tabel (phone_number, text) VALUES ('$phone','$message')
        // How to Create Query? 
        // Thank you.
        }

?>
gacoekchip.pokher 0 Newbie Poster

I had used Gammu SMS Gateway to do so. http://wammu.eu/

gacoekchip.pokher 0 Newbie Poster

Hi All,
How to Play Sound where record of mysql table is added?.
thank you.

gacoekchip.pokher 0 Newbie Poster

okey, thank you.

gacoekchip.pokher 0 Newbie Poster

where i can get the tool to read and decipher the BIOS information?.
thank you.

gacoekchip.pokher 0 Newbie Poster

Hi all, help me please.
how to protect php script that can only be installed only for the one PC?.
Thank you.

gacoekchip.pokher 0 Newbie Poster

how to Get motherboard Serial number from localhost?

gacoekchip.pokher 0 Newbie Poster

Get Harddisk Serial number from localhost

<?php

function GetVolumeLabel($drive) {
  // Try to grab the volume name
  if (preg_match('#Volume Serial Number is (.*)\n#i', shell_exec('dir '.$drive.':'), $m)) {
    $volname = ' ('.$m[1].')';
  } else {
    $volname = '';
  }
return $volname;
}

$serial =  str_replace("(","",str_replace(")","",GetVolumeLabel("c")));

echo $serial;

?>
gacoekchip.pokher 0 Newbie Poster

@pritaeas:
multi query = create multiple query at once

gacoekchip.pokher 0 Newbie Poster

@Taywin:
yes,

$string = "I LOVE YOU";
$phone_number=$phone;// value from contact table['phone']
$qr_outbox = "INSERT INTO outbox(phone_number,message ) 
VALUES ('$phone_number','$string')";
$rs_outbox = mysql_query($qr_outbox);
gacoekchip.pokher 0 Newbie Poster
//line1
$sql="UPDATE table1 SET col2='$p' WHERE col1='$p' AND col2 IS NULL";
//line2
$sql="INSERT INTO user(u_id,u_uname, u_fname, u_lname) VALUES ('$q','$username','$fname','$lname')"
gacoekchip.pokher 0 Newbie Poster

I do not know the mysqli extension. thank you

gacoekchip.pokher 0 Newbie Poster

I am using gammu for project sms gateway

gacoekchip.pokher 0 Newbie Poster

It is my project sms gateway, i want to send message to group.

/* 
$massage = "I LOVE YOU";
$string = $massage;
*/

I am sorry because my english is bad.

gacoekchip.pokher 0 Newbie Poster

it problem = problem multy query.
"written query it = how to query it?
I want to insert into outbox (phone_number,message)

/*
$phone_number=$phone   from contact table;
$string = "I LOVE YOU";
*/
gacoekchip.pokher 0 Newbie Poster

Hi all,
Help me please.
i have two table: outbox and contact.
condition outbox table befor query/ insert.

CREATE TABLE outbox (
id int(11) NOT NULL,
phone_number varchar(30) NOT NULL,
message varchar(200) NOT NULL,
PRIMARY KEY (id)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

Contact table:
CREATE TABLE contact (
id int(11) NOT NULL auto_increment,
name varchar(30) NOT NULL,
phone varchar(20) NOT NULL,
PRIMARY KEY (id)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;

INSERT INTO contact VALUES (1, 'jana', '+60111');
INSERT INTO contact VALUES (2, 'jani', '+60222');
INSERT INTO contact VALUES (3, 'janu', '+60333');

I Want to insert a string to outbox table.

$string = "I LOVE YOU";

condition outbox table After Query/insert: Row of outbox table is:

CREATE TABLE outbox (
id int(11) NOT NULL,
phone_number varchar(30) NOT NULL,
message varchar(200) NOT NULL,
PRIMARY KEY (id)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

INSERT INTO outbox VALUES (1, '+60111, 'I LOVE YOU');
INSERT INTO outbox VALUES (2, '+60222', 'I LOVE YOU');
INSERT INTO outbox VALUES (3, '+60333', 'I LOVE YOU');

How i write multy query mysql using php for it problem, thank you.

?php
$string = "I LOVE YOU";
$qr_contact = "SELECT * FROM contact";
$rs_contact = mysql_query($qr_contact);
while($data_contact = mysql_fetch_array($rs_contact))
{
  $id = $data_contact['id'];
  $name = $data_contact['name'];
  $phone = $data_contact['phone'];
  $xx = mysql_num_rows($rs_contact);
$phone_number=$phone;
$qr_outbox = "INSERT INTO outbox(id,phone_number,message ) VALUES ('','$phone_number','$string')";
$rs_outbox = mysql_query($qr_outbox); //how i written Query againt...?
/* how i written Query it?. 
After query Row of outbox table is:
id    phone_number …
gacoekchip.pokher 0 Newbie Poster
<?php
$string = "I LOVE YOU";

$qr_contact = "SELECT * FROM contact";
$rs_contact = mysql_query($qr_contact);

while($data_contact = mysql_fetch_array($rs_contact))
{
  $id = $data_contact['id'];
  $name = $data_contact['name'];
  $phone = $data_contact['phone'];
  $xx = mysql_num_rows($rs_contact);

$phone_number=$phone;

$qr_outbox = "INSERT INTO outbox(id,phone_number,message ) VALUES ('','$phone_number','$string')";
$rs_outbox = mysql_query($qr_outbox); //how i written Query againt...?

/* how i written Query it?. 
After query Row of outbox table is:

id    phone_number       message                
1       +60111          I LOVE YOU 
2       +60222          I LOVE YOU
3       +602333         I LOVE YOU
*/

}

?> 
gacoekchip.pokher 0 Newbie Poster

Hi All,
Help me please...!
How to get harddisk serial number and motherboard serial number using php?.
Thank.

gacoekchip.pokher 0 Newbie Poster

Hi all,
Help me please.
i have two table: outbox and contact.
condition outbox table befor query/ insert.
CREATE TABLE outbox (
id int(11) NOT NULL,
phone_number varchar(30) NOT NULL,
message varchar(200) NOT NULL,
PRIMARY KEY (id)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

Contact table:
CREATE TABLE contact (
id int(11) NOT NULL auto_increment,
name varchar(30) NOT NULL,
phone varchar(20) NOT NULL,
PRIMARY KEY (id)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;

INSERT INTO contact VALUES (1, 'jana', '+60111');
INSERT INTO contact VALUES (2, 'jani', '+60222');
INSERT INTO contact VALUES (3, 'janu', '+602333');

I Want to insert a string to outbox table.
$string = "I LOVE YOU";

condition outbox table After Query/insert: Row of outbox table is:
CREATE TABLE outbox (
id int(11) NOT NULL,
phone_number varchar(30) NOT NULL,
message varchar(200) NOT NULL,
PRIMARY KEY (id)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

INSERT INTO outbox VALUES (1, '+60111, 'I LOVE YOU');
INSERT INTO outbox VALUES (2, '+60222', 'I LOVE YOU');
INSERT INTO outbox VALUES (3, '+60333', 'I LOVE YOU');

How i write multy query mysql using php for it problem, thank you.