franknu Posted December 19, 2006 Share Posted December 19, 2006 ok i want this data to be send to one row instead of two diffrent rows the text is going to on row and the file is going to a diffrent one please help[code=php:0]<?$host = "localhost";$username = "townsfin_localho";$password = "abc123";$database = "townsfin_contacts";$db = mysql_connect($host, $username, $password);mysql_select_db($database); // Business Owner $First_Name = addslashes($_POST['First_Name']); $Last_Name= addslashes($_POST['Last_Name']); $Owner_Address = addslashes($_POST['Owner_Address']); $State= addslashes($_POST['State']); $City= addslashes($_POST['City']); $Zip= addslashes($_POST['Zip']); $Tel= addslashes($_POST['Tel']); $Email= addslashes($_POST['Email']); $Position=addslashes($_POST['Position']); $Comments=addslashes($_POST['Comments']);// Business Info $BusinessName = addslashes ($_POST['BusinessName']); $Slogan = addslashes($_POST['Slogan']); $Business_Address = addslashes($_POST['Business_Address']); $Tel = addslashes($_POST['Tel']); $Website = addslashes($_POST['Website']); $Email = addslashes($_POST['Email']); $Member_Status = addslashes($_POST['Member_Status']); $Fax =addslashes($_POST['Fax']); $type = addslashes($_POST['type']); $make = addslashes($_POST['make']);// webpage info $Categories = addslashes($_POST['Categories']); $Keyword = addslashes ($_POST['Keyword']); $Picture1 = addslashes (isset ($_POST['Picture1'])); $Headline = addslashes ($_POST['Headline']); $Slogan2 = addslashes ($_POST['Slogan2']); $Description1 = addslashes ($_POST['Description1']); $Description2 = addslashes ($_POST['Description2']); $Description3= addslashes ($_POST['Description3']); $Contact2 = addslashes ($_POST['Contact2']); $Picture2 = addslashes (isset($_POST['Picture2'])); $Picture3 = addslashes (isset($_POST['Picture3'])); $User_Name = addslashes ($_POST['User_Name']); $Password = addslashes ($_POST['Password']);if(!$db){echo " Error: could not connect to database.";exit; } //Business Info $sql="INSERT INTO `business_info`(`BusinessName`,`Slogan`,`Business_Address`,`Tel`,`Website`,`Email`,`Member_Status`, `Fax`,`type`,`make`,`Categories`,`Keyword`,`picture1`,`Headline`,`Slogan2`,`Description1`,`Description2`,`Description3`,`Contact2`, `Picture2`,`Picture3`,`User_Name`,`Password`)Values('$BusinessName','$Slogan','$Business_Address','$Tel','$Website','$Email','$Member_Status','$Fax','$type','$make','$Categories','$Keyword','$Picture1','$Headline','$Slogan2','$Description1','$Description2','$Description3','$Contact2','$Picture2','$Picture3','$User_Name','$Password')";$result = mysql_query($sql);echo mysql_error();if($result) {echo mysql_affected_rows(). ".Business Information Inserted."; }$uploaddir = '/home/townsfin/public_html/business_images/';$uploadfile = $_FILES['Picture1']['name']; // No need for basename() hereif(!empty($_FILES['Picture1'])){ var_dump($uploaddir); var_dump($_FILES['Picture1']['size']); var_dump($_FILES['Picture1']['error']); var_dump($_FILE); var_dump($_FILES['Picture1']['type']); var_dump($_FILES['Picture1']['name']);}$fullpath = $uploaddir . $uploadfile;if (move_uploaded_file($_FILES['Picture1']['tmp_name'], $fullpath)){ echo("File Uploaded"); $sql = "INSERT INTO business_info (Picture1) VALUES ('$fullpath')"; $result = mysql_query($sql); if (!$result){ echo "Error inserting data: " . mysql_error(); }}else { echo ("file no uploaded!"); print_r($_FILES); echo realpath('./');}?>[/code] Quote Link to comment Share on other sites More sharing options...
tracy Posted December 19, 2006 Share Posted December 19, 2006 could you elaborate?...I don't understand what you are asking... Quote Link to comment Share on other sites More sharing options...
franknu Posted December 20, 2006 Author Share Posted December 20, 2006 the info that i am getting from my form is going to two diffrent rows. i want the data that is input by the user to be send in only one row on the databasei know that i have two insert statement in my code, one for my database and another one for the path for the file that is being insert please help Quote Link to comment Share on other sites More sharing options...
tracy Posted December 20, 2006 Share Posted December 20, 2006 Is it simply displaying two rows because there is not enough room no the screen to show all in one? It's 23 columns right? They might not fit into one row...is that the issue? Might seem like a silly question but it might be the answer... Quote Link to comment Share on other sites More sharing options...
franknu Posted December 21, 2006 Author Share Posted December 21, 2006 yes i have 24 colums?so do i have to delete some colums Quote Link to comment Share on other sites More sharing options...
tracy Posted December 21, 2006 Share Posted December 21, 2006 I don't guess you HAVE to, but if all those columns won't display across one screen, then that is likely your problem...and in my opinion deleting some columns from this display php code could solve it. I don't think you should necessarily delete them from the database, perhaps just the table being displayed on the php page in question.[quote author=franknu link=topic=119284.msg489609#msg489609 date=1166712271]yes i have 24 colums?so do i have to delete some colums[/quote] Quote Link to comment Share on other sites More sharing options...
franknu Posted December 21, 2006 Author Share Posted December 21, 2006 i made my database 22 colums and still the file is uploaded file is going to a diffrent row please help Quote Link to comment Share on other sites More sharing options...
tracy Posted December 21, 2006 Share Posted December 21, 2006 if you choose say five columns to display on your php page, how does that look?[quote author=franknu link=topic=119284.msg489634#msg489634 date=1166714255]i made my database 22 colums and still the file is uploaded file is going to a diffrent row please help[/quote] Quote Link to comment Share on other sites More sharing options...
franknu Posted December 21, 2006 Author Share Posted December 21, 2006 ok i have a form where all the data is being submitted from all the text goes to one row but the file is going to the next row, i think that my problem is on the insert code Quote Link to comment Share on other sites More sharing options...
tracy Posted December 21, 2006 Share Posted December 21, 2006 What I'm saying is this...if you send that much data to the browser, it seems to me that it must go on at least two lines because all of it won't print on one...or am I misunderstanding the issue?[quote author=franknu link=topic=119284.msg489638#msg489638 date=1166714552]ok i have a form where all the data is being submitted from all the text goes to one row but the file is going to the next row, i think that my problem is on the insert code[/quote] Quote Link to comment Share on other sites More sharing options...
franknu Posted December 21, 2006 Author Share Posted December 21, 2006 ok all the data is being send the database, all i want is the data to be inserted into the database on the same row Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.