-
Posts
442 -
Joined
-
Last visited
Everything posted by I-AM-OBODO
-
hi, i have a form that requires image to be uploaded. i know how to store the form values in a database but i don't know how to store the image into the database. i want the user to upload picture and preview the data provided review (including the image) before submitting to the database. thanks
-
Thanks But i tried googling to no avail. i saw many with complications. need something straight forward and simple
-
Hi, Pls where can i get a polling, blogging and pix rating script that is easy to manage, should have a db and an admin feature. any help will be appreciated
-
Hi. i don't know my query result is replicating itself. tried my head out, someone pls help before i go bananas if(isset($_POST['Submit'])){ $search = $_POST['search']; if($search ==''){ echo "<font size=3 color=red><b>Search field empty. <input type='button' value='Try Again' onClick='history.go(-1)'><br>"; }else{ $query = "SELECT t1.ParcelDesc, t1.DeliveryAddress, t1.New_Address, t2.status, t2.remarks FROM parcels t1 JOIN parcel_status t2 ON t1.Email=t2.username WHERE t1.ParcelDesc = '$search' AND t1.Email = '$_SESSION[username]' "; $result = (mysql_query($query)); if(mysql_num_rows($result) < 1){ echo ("<font size=3 color=red><b>No Match Found. <input type='button' value='Try Again' onClick='history.go(-1)'>"); }else{ $num_rows = mysql_num_rows($result); //print "There are $num_rows records.<P>"; echo "<table width= '100%' border='1' bordercolor='#000000' cellpadding='1' cellspacing='1'> <tr > <th>Parcel-Desc</th> <th>Recipient Name & Address</th> <th>New Address</th> <th>Remarks</th> <th>Status</th> </tr>"; while ($get_info = mysql_fetch_row($result)){ print "<tr >\n"; foreach ($get_info as $field) print "\t<td ><font face=arial size=2/>$field</font></td>\n"; print "</tr>\n"; } print "</table>\n"; print "<br>"; //mysql_close($link); } } }
-
Hi, i've gotten somewhere so far but the problem now is the result i get is replicated. tried to find out why but to no avail. pls somebody help my eyes are bleeding now. thanks my code below $query = "SELECT t1.ParcelDesc, t1.DeliveryAddress, t1.New_Address, t2.status, t2.remarks FROM parcels t1 JOIN parcel_status t2 ON t1.Email=t2.username WHERE t1.ParcelDesc = '$parcel_desc' AND t1.Email = '$username' "; $result = (mysql_query($query)); if(mysql_num_rows($result) < 1){ echo ("<font size=3 color=red><b>No Match Found. <input type='button' value='Try Again' onClick='history.go(-1)'>"); }else{ $num_rows = mysql_num_rows($result); //print "There are $num_rows records.<P>"; echo "<table width= '100%' border='1' bordercolor='#000000' cellpadding='1' cellspacing='1'> <tr > <th>Parcel-Desc</th> <th>Recipient Name & Address</th> <th>New Address</th> <th>Remarks</th> <th>Status</th> </tr>"; while ($get_info = mysql_fetch_row($result)){ print "<tr >\n"; foreach ($get_info as $field) print "\t<td ><font face=arial size=2/>$field</font></td>\n"; print "</tr>\n"; } print "</table>\n"; print "<br>";
-
Hi. Below is the dump for my table, but the fields i want to join is for parcels( ParcelDesc, DeliveryAddress, New_Address) for parcel_status(status, remarks) note: parcels table parcel_status table txnref transref Email username ParcelDesc parcel_desc and my search criteria is parce_desc SQL DUMP CREATE TABLE IF NOT EXISTS `parcels` ( `Firstname` varchar(50) NOT NULL, `Surname` varchar(50) NOT NULL, `OfficialAddress` varchar(100) NOT NULL, `BillingAddress` varchar(100) NOT NULL, `Email` varchar(50) NOT NULL, `AltEmail` varchar(50) NOT NULL, `Phone` varchar(50) NOT NULL, `txnref` varchar(50) NOT NULL, `amount` int(50) NOT NULL, `ParcelDesc` varchar(50) NOT NULL, `ItemUnit` int(100) NOT NULL, `ApproWei` int(10) NOT NULL, `Destination` varchar(100) NOT NULL, `DeliveryAddress` varchar(100) NOT NULL, `date_of_order` date NOT NULL, `New_Address` varchar(45) NOT NULL, UNIQUE KEY `txnref` (`txnref`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE IF NOT EXISTS `parcel_status` ( `SN` int(10) NOT NULL AUTO_INCREMENT, `transref` int(30) NOT NULL, `username` varchar(50) NOT NULL, `parcel_desc` varchar(50) NOT NULL, `item_unit` int(5) NOT NULL, `time` time NOT NULL, `destination_add` varchar(50) NOT NULL, `date` date NOT NULL, `status` varchar(20) NOT NULL, `remarks` varchar(100) NOT NULL, `date_order` date NOT NULL, `processed` varchar(30) NOT NULL, PRIMARY KEY (`SN`), UNIQUE KEY `transref` (`transref`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=31 ;
-
Thanks all so far. thanks fenway, i forgot to remove those perans when posting my code cos they are part of some functions i did not include on the code i showed you cos i feel its not part of the problem and if you observe well, i posted the error i had. Now after doing some changes, i got the replicated queries, i mean instead of giving me one result, it duplicates the results into 3. this is my new query. $query = "SELECT t1.ParcelDesc, t1.DeliveryAddress, t1.New_Address, t2.status, t2.remarks FROM parcels t1 JOIN parcel_status t2 ON t1.Email=t2.username WHERE t1.ParcelDesc = '$parcel_desc' AND t1.Email = '$username'";
-
I don't know why am not getting it. this is the error i am getting: Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\wamp\www\Nexpress\admin\nxt_pcl_report4.php on line 63 and this is my code: $parcel_desc = $_Post['parceldesc']; if($parcel_desc ==''){ echo "<font size=3 color=red><b>Search field empty. <input type='button' value='Try Again' onClick='history.go(-1)'><br>"; }else{ $query = "SELECT t1.ParcelDesc, t1.DeliveryAddress, t1.New_Address, t2.status, t2.remarks FROM parcels t1 JOIN parcel_status t2 ON t1.Email=t2.username WHERE t1.ParcelDesc = $parcel_desc AND Email = '$username' ORDER BY date_of_order DESC"; $result = (mysql_query($query)); if(mysql_num_rows($result) < 1){ echo ("<font size=3 color=red><b>No Match Found. <input type='button' value='Try Again' onClick='history.go(-1)'>"); }else{ $num_rows = mysql_num_rows($result); print "There are $num_rows records.<P>"; echo "<table width= '100%' border='1' bordercolor='#000000' cellpadding='1' cellspacing='1'> <tr > <th>Parcel-Desc</th> <th>Recipient Name & Address</th> <th>New Address</th> <th>Remarks</th> <th>Status</th> </tr>"; while ($get_info = mysql_fetch_row($result)){ print "<tr >\n"; foreach ($get_info as $field) print "\t<td ><font face=arial size=2/>$field</font></td>\n"; print "</tr>\n"; } print "</table>\n"; print "<br>"; //mysql_close($link); } } } ?> PS: PS: table names are parcels and parcel_status respectively. [b]parcels table parcel_status table[/b] ParcelDesc = parcel_desc Email = username Hope this is helpful Thanks you all
-
Thanks for your response, but i seem not able to figure it out. my code is this $query = "SELECT friend, relation, community FROM table1 AND street, people FROM table2 WHERE username = '$username AND Email = '$email'"; $result = mysql_query($query); if(mysql_num_rows($result) < 1){ echo ("<font size=3 color=red><b>No Match Found. <input type='button' value='Try Again' onClick='history.go(-1)'>"); }else{ $num_rows = mysql_num_rows($result); print "There are $num_rows records.<P>"; echo "<table width= '100%' border='1' bordercolor='#000000' cellpadding='1' cellspacing='1'> <tr > <th>Friend</th> <th>Relation</th> <th>Community</th> <th>Street</th> <th>People</th> </tr>"; while ($get_info = mysql_fetch_row($result)){ print "<tr >\n"; foreach ($get_info as $field) print "\t<td ><font face=arial size=2/>$field</font></td>\n"; print "</tr>\n"; } print "</table>\n"; print "<br>"; } What i want is the query from table1 and table2 so that they can output as one Thanks
-
Pls how do i check all my threads
-
Hello, I have two tables i'd like to pull specific data from. the relationship btw the two table is the email address. how do i do a join. thanks
-
Helo. I am not sure what to call my subject, but what am asking is this: in my db i am a column for serial number, lets say i want a couple rows for a particular user who has many entries (in the db his entries might be in serial number 4, 7, 15, 100 etc) is there a way that i can sieve the output so i just get 1, 2, 3 etc for that user and any user base on my comand? Thanks
-
Helo. Pls how can i export just the result of a row in my database to excel, pdf and to print with just a click. Ps. Its 3 different question; print, excel, and pdf. Thanks
-
The problem now is how to make the result of my calculation (date diff) apear in al the rows in my table. This is wat i hav in my code <?php $query = "select date, date_order from table where description = '$description'"; $result = (mysql_query($query)); while ($newArray=(mysql_fetch_array($result))){ $date = $newArray['date']; $date_order = $newArray['date_order']; $time1=strtotime($date_order); $time2=strtotime($date); $check=date("d:m:Y",$time2); $check2=date("d:m:Y",$time1); $diff = intval(($time1 - $time2) / 86400 + 1)); echo $diff; ?> the problem is i have many field in my tables that match query but query outputs only one result. I want the difference be linked to each row in table Thanks
-
Just like mrMarcus explained, try to make your tag consistant with what's in vogue. You could use a saparate page for your html form and your php script in a separate page to make your job much neater and simpler.
-
Thanks for the tip. Got it now. Many thanks
-
Hi all. In my database i want to pull out the dates from two different tables. What i did was as pull out the date from one table and assigned it to a variable and used session to pass it to another page which has the second table that contains the second date etc. $first_date=$_Session['date1']; $query="SELECT * FROM table2 WHERE name = 'name'"; $result = mysq_query('$query'); blah blah blah Note: the date format is 200-10-10 How do i get the difference between the dates? Hope am making sense here, or a better way of getting the required results. Thanks
-
Helo, I have a file i don't want unauthorised users to access. I created a login to the page restricting access, but if one knows the name of the file and type it on the browser the file loads and subsiquently can be accessed and downloaded. eg www.mysite.com/user/getfile/file.exe the file to be protected is the file.exe and its located on the get file page which you can access only if you have a valid username and password. but if typed the address as shown above file is downloaded. how do i restrict access to this file? please and thanks
-
thanks alot. I have done the login and it worked fine but i was wondering if i could make the user expire after some days of first login lets assume 4 days after first login. thanks alot
-
I have seen where wronged and i have now fixed it. Thanks all the same.
-
how do i do that! thanks
-
Oh! thanks for the help. I have designed the login and all seems to be working fine, but the problem now is when a user is loggen in, and for a reason or another he refreshed the page, the log count increases by 1 and its a problem. Is there a way of solving these? Thanks
-
I have not started anything on it yet, i was just told i if i could do something like that and i told them i could. i am doing it from the scrash. the code you gave, would it work with a basic usrname and password login? modified of corse
-
will this delete both the username and password?
-
thanks. will try anyway