Jump to content

newcoder

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

newcoder's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. i am trying to combine 4 separate .csv to use in a search page foe my client the files will be updated all the time so i am a lil confused on where i should go here's the code and im wondering about an array_push??????? <?php $dbvoip = sqlite_open($_SERVER['DOCUMENT_ROOT']."/../data/voip.db"); if ($dbvoip == false) { die ('Unable to open database'); } else { //echo 'Database created.'; } $dbinfo1=file("atlMaster.csv"); $dbinfo2=file("cseMaster.csv"); $dbinfo3=file("pacMaster.csv"); $dbinfo4=file("parMaster.csv"); foreach ($dbinfo as $dbquery); { //$data =implode(",",$dbquery); $dbquery = "INSERT INTO voiplog ( number1, number2, type, number3, linetype, c1, dial, c2, date1, date2, date3, c3, c4, anw, Documentaion, unix) VALUES ($dbquery)"; echo($dbquery); } //sqlite_close($dbvoip) $pageQuery = "SELECT * FROM voiplog "; $pageResult = sqlite_query($dbvoip, $pageQuery); //echo $pageResult; if(isset($_GET['submitted']) && $_GET["submitted"] == "send")// line check { if ($_GET["number1"] !="") $conditions[] = " number1 =\"" .$_GET["number1"]."\""; if ($_GET["number2"] !="") $conditions[] = " number2=\"".$_GET["number2"]."\""; if ($_GET["type"] !="") $conditions[] = " type=\"".$_GET["type"]."\""; if ($_GET["number3"] !="") $conditions[] = " number3=\"".$_GET["number3"]."\""; if ($_GET["linetype"] !="") $conditions[] = " linetype=\"".$_GET["linetype"]."\""; if ($_GET["c1"] !="") $conditions[] = " c1=\"".$_GET["c1"]."\""; if ($_GET["dial"] !="") $conditions[] = " dial=\"".$_GET["dial"]."\""; if ($_GET["c2"] !="") $conditions[] = " c2=\"".$_GET["c2"]."\""; if ($_GET["date1"] !="") $conditions[] = " date1=\"".$_GET["date1"]."\""; if ($_GET["date2"] !="") $conditions[] = " date2=\"".$_GET["date2"]."\""; if ($_GET["date3"] !="") $conditions[] = " date3=\"".$_GET["dtae3"]."\""; if ($_GET["c3"] !="") $conditions[] = " c3=\"".$_GET["c3"]."\""; if ($_GET["c4"] !="") $conditions[] = " c4=\"".$_GET["c4"]."\""; if ($_GET["anw"] !="") $conditions[] = " anw=\"".$_GET["anw"]."\""; if ($_GET["Documentaion"] !="") $conditions[] = " Documentaion=\"".$_GET["Documentaion"]."\""; if ($_GET["unix"] !="") $conditions[] = " unix=\"".$_GET["unix"]."\""; } ?> <html> <head> <title>VOIP DB</title> </head> <body> <h1 align=center><b>--VOIP SEARCH--</b></h1> <h1 align=left>Please enter search fields:</h1> <body bgcolor="000000" text="FFFFFF"> <form method="get"> : <select name="page"> <option value=""></option> </select> : <select name=" "> <option value=""></option> </select> : <input type=" " name=" "> <option value=""></option> : <input type=" " name=" "> <option value=""></option> <p><input name="submitted" type="submit" value="send"/></p></form> <style type='text/css'> <table { border-width: 1px; border-spacing:0px ; border-style: double; border-color: black; border-collapse: separate; background-color: #0000FF; } table tr { border-width: 1px; padding: 3px; border-style: solid; border-color: black; background-color: #0000FF; } table th { border-width: 1px; padding: 0px; border-style: solid; border-color: black; background-color: #0000FF; } table td { border-width: 1px; padding: 3px; border-style: solid; border-color: black; background-color: #0000FF; } </style> <table class='db'; cellspacing=\"0px\">"; </html>
  2. heres the code and im wondering about an array_push??????? <?php $dbvoip = sqlite_open($_SERVER['DOCUMENT_ROOT']."/../data/voip.db"); if ($dbvoip == false) { die ('Unable to open database'); } else { //echo 'Database created.'; } $dbinfo1=file("atlMaster.csv"); $dbinfo2=file("cseMaster.csv"); $dbinfo3=file("pacMaster.csv"); $dbinfo4=file("parMaster.csv"); foreach ($dbinfo as $dbquery); { //$data =implode(",",$dbquery); $dbquery = "INSERT INTO voiplog ( number1, number2, type, number3, linetype, c1, dial, c2, date1, date2, date3, c3, c4, anw, Documentaion, unix) VALUES ($dbquery)"; echo($dbquery); } //sqlite_close($dbvoip) $pageQuery = "SELECT * FROM voiplog "; $pageResult = sqlite_query($dbvoip, $pageQuery); //echo $pageResult; if(isset($_GET['submitted']) && $_GET["submitted"] == "send")// line check { if ($_GET["number1"] !="") $conditions[] = " number1 =\"" .$_GET["number1"]."\""; if ($_GET["number2"] !="") $conditions[] = " number2=\"".$_GET["number2"]."\""; if ($_GET["type"] !="") $conditions[] = " type=\"".$_GET["type"]."\""; if ($_GET["number3"] !="") $conditions[] = " number3=\"".$_GET["number3"]."\""; if ($_GET["linetype"] !="") $conditions[] = " linetype=\"".$_GET["linetype"]."\""; if ($_GET["c1"] !="") $conditions[] = " c1=\"".$_GET["c1"]."\""; if ($_GET["dial"] !="") $conditions[] = " dial=\"".$_GET["dial"]."\""; if ($_GET["c2"] !="") $conditions[] = " c2=\"".$_GET["c2"]."\""; if ($_GET["date1"] !="") $conditions[] = " date1=\"".$_GET["date1"]."\""; if ($_GET["date2"] !="") $conditions[] = " date2=\"".$_GET["date2"]."\""; if ($_GET["date3"] !="") $conditions[] = " date3=\"".$_GET["dtae3"]."\""; if ($_GET["c3"] !="") $conditions[] = " c3=\"".$_GET["c3"]."\""; if ($_GET["c4"] !="") $conditions[] = " c4=\"".$_GET["c4"]."\""; if ($_GET["anw"] !="") $conditions[] = " anw=\"".$_GET["anw"]."\""; if ($_GET["Documentaion"] !="") $conditions[] = " Documentaion=\"".$_GET["Documentaion"]."\""; if ($_GET["unix"] !="") $conditions[] = " unix=\"".$_GET["unix"]."\""; } ?> <html> <head> <title>VOIP DB</title> </head> <body> <h1 align=center><b>--VOIP SEARCH--</b></h1> <h1 align=left>Please enter search fields:</h1> <body bgcolor="000000" text="FFFFFF"> <form method="get"> : <select name="page"> <option value=""></option> </select> : <select name=" "> <option value=""></option> </select> : <input type=" " name=" "> <option value=""></option> : <input type=" " name=" "> <option value=""></option> <p><input name="submitted" type="submit" value="send"/></p></form> <style type='text/css'> <table { border-width: 1px; border-spacing:0px ; border-style: double; border-color: black; border-collapse: separate; background-color: #0000FF; } table tr { border-width: 1px; padding: 3px; border-style: solid; border-color: black; background-color: #0000FF; } table th { border-width: 1px; padding: 0px; border-style: solid; border-color: black; background-color: #0000FF; } table td { border-width: 1px; padding: 3px; border-style: solid; border-color: black; background-color: #0000FF; } </style> <table class='db'; cellspacing=\"0px\">"; </html>
  3. thorpe thanks for letting me know. heres a little more of a tuned explanation... I have 4 excel files that contain 17 col a piece with..well just say an infinite amount of rows. OK well i need to be able to make a form that a "user" can input information into, and be able to search thru them for specific info. these excel docs are going to have info continuously updated into them. so naturally i cant use the "copy's" i have. i need to be able to go back to them and "pull" the data out when the "user" asks for it. my question is ...' how the hell do i do that' LOL ie. not input the file to a db or do i and is there a way of having that db keeping updated act as the reference point for the search. i hope this is better and if I'm still vague in any area please let me know. i am still very new to this process.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.