djdellux Posted December 17, 2008 Share Posted December 17, 2008 hello all on this wonderful hump day. Link to comment https://forums.phpfreaks.com/topic/137362-if-statment/ Share on other sites More sharing options...
djdellux Posted December 17, 2008 Author Share Posted December 17, 2008 damn clicked it to fast or something lol im making a viwer for a db that i created and now ive been informed that i need to include 4 othe files to it which will be updating on a regular basis. being that im still fairly new i know an if statement is probably the way to go but i am not 100% sure on how to accomplish it with a continuing update. heres my code if you guys could take a look at it and let me know what ya think that would be great thanks in advance <?php $dbvoip = sqlite_open($_SERVER['DOCUMENT_ROOT']."/../data/voip.db"); if ($dbvoip == false) { die ('Unable to open database'); } else { echo 'Database created.'; } $dbinfo=file("master.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; ?> Link to comment https://forums.phpfreaks.com/topic/137362-if-statment/#findComment-717682 Share on other sites More sharing options...
djdellux Posted December 17, 2008 Author Share Posted December 17, 2008 this is my if statement im proposing but i have yet to figure out the multipl file thing and making the code to be able to pull from those $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"]."\""; ?> Link to comment https://forums.phpfreaks.com/topic/137362-if-statment/#findComment-717707 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.