Urgent support required

Urgent support required

Postby rawia_tsalih » Thu Mar 24, 2016 7:37 pm

Dears

please I need very urgent help do anyone can support?

I have two tables service and billing, and want to insert into some billing table column values selected from service table where service.entry_no = input number to form


<?php

$db = new_mysqli('"host","user", "pass", "db"); // I removed the origin info to post it here

$entry = mysql_real_escape_string($_post['entry']);

$entry_date = $db->query("select Entry_date from service where entry_no = $entry");
$costumer = $db->query("select costumer from service where entry_no = $entry");
$service_type = $db->query("select service_type from service where entry_no = $entry");
$expected = $db->query("select expected from service where entry_no = $entry");
$advanced = $db->query("select advanced from service where entry_no = $entry");
$technician_notes = $db->query("select technician_notes from service where entry_no = $entry");

while ($row = $result->fetch_object()) { $db->query("insert into billing entry_number, service_entry_date , costumer_name, service_type, rate, advanced, technician_notes
values ('{$entry_date}','{$costumer}','{$service_type}', '{$expected}','{$advanced}', '{$technician_notes}');
}


?>



Best
rawia_tsalih
 
Posts: 6
Joined: Thu Mar 17, 2016 4:36 am

Re: Urgent support required

Postby admin » Thu Mar 31, 2016 7:22 am

rawia_tsalih,

This seems to have nothing to do with nuBuilder.

Are you aware of the nuBuilder function nuRunQuery(). http://wiki.nubuilder.net/nubuilderv3/index.php/PHP_Functions#nuRunQuery.28.5B.24sql_.3D_.5D_.5B.2C_.24variables_.3D_array.28.29.5D_.5B.2C.24isInsert_.3D_false.5D.29

Steven.
admin
Site Admin
 
Posts: 3406
Joined: Mon Jun 15, 2009 9:53 am
nuBuilder Version: 4.5

Re: Urgent support required

Postby rawia_tsalih » Thu Mar 31, 2016 10:47 pm

Dear Admin

thanks a lot for your support please would you advise me where is the mistake I did what you recommended but still not retrieve data or do insert...


the php code is


$entry = mysql_real_escape_string($_post['entry']);

$query="INSERT INTO `hupayi_com`.`ra_Invoice` (`ra_inv_servcie_entry`, `ra_inv_service_type`, `ra_inv_customer`, `ra_inv_technician_note`, `ra_inv_expected`, ``ra_inv_advanced)
SELECT ``ra_services_entry, `ra_s_service_type`, `ra_s_customer`, `ra_s_technician_notes` , `ra_s_expected`, `ra_s_balanced`
FROM `hupayi_com`.`ra_services`
WHERE `ra_services_entry` LIKE `$entry`";

nuRunQuery($query);


and I snapshot the screens 1,2,3,4,and 6 the steps are attached please help me
Attachments
6.jpg
6.jpg (61.69 KiB) Viewed 2794 times
4.jpg
4.jpg (35.06 KiB) Viewed 2794 times
3.jpg
3.jpg (48.1 KiB) Viewed 2794 times
2.jpg
2.jpg (59.7 KiB) Viewed 2794 times
1.jpg
1.jpg (52.69 KiB) Viewed 2794 times
rawia_tsalih
 
Posts: 6
Joined: Thu Mar 17, 2016 4:36 am

Re: Urgent support required

Postby admin » Fri Apr 15, 2016 9:09 am

rawia_tsalih,

nuRunPHP(INFUNC) should be nuRunPHP('INFUNC')

That is all I can see is wrong.

Steven
admin
Site Admin
 
Posts: 3406
Joined: Mon Jun 15, 2009 9:53 am
nuBuilder Version: 4.5


Return to Custom Code