urtrivedi 276 Nearly a Posting Virtuoso

search in google for JQUERY-UI,
then see examples of AUTOCOMPLETE

urtrivedi 276 Nearly a Posting Virtuoso

YOU can remove it and make it to

$where="";

urtrivedi 276 Nearly a Posting Virtuoso
if(isset($_GET['advance_searching']) && !empty($_GET))
{

$where = " 1 = 1 ";
if($_POST['search_remarks']!="")	{
$s[] = "`remarks` like '%"	. mysql_real_escape_string($_POST['search_remarks']) . "%'";
}

if($_POST['search_industry']!="")	{
$s[] = "`industry` like '%"	. mysql_real_escape_string($_POST['search_industry']) . "%'";
}

if($_POST['search_position']!="")	{
$s[] = "`position` like '%"	. mysql_real_escape_string($_POST['search_position']) . "%'";
}

if($_POST['search_location']!="")	{
$s[] = "`location` like '%"	. mysql_real_escape_string($_POST['search_location']) . "%'";
}

if($_POST['age_one']!="" && $_POST['age_two']!="")	{
	$s[] = "(`age` between "	. intval($_POST['age_one']) ." AND ".intval($_POST['age_two']) .")";
}

if(isset($s)){
$where = "WHERE (" . implode(" AND ",$s).")";

}


}

$query_str = "SELECT * FROM resumevault {$where}";
echo $query_str;
urtrivedi 276 Nearly a Posting Virtuoso

not need to write COLUMN AND QUOTE

$insertQuery = "ALTER TABLE atable ADD  $example INT";
urtrivedi 276 Nearly a Posting Virtuoso

if you have phpmyadmin then , get output your query using echo, then copy that query to phpmyadmin, and run. see what error you are getting there.

.
.
.
$query="SELECT symSymbol,................. LIMIT 10";

echo $query;

$result = @$db->query($query);
.
.
.
.
urtrivedi 276 Nearly a Posting Virtuoso

I think you have bunked your class in your college when your professor was teaching you variables.

No condition required at all, remove all if condition and keep following link in first page.

Response.Redirect("Search Page.aspx?Category=" & Category.SelectedItem.Value & "&Product=" &  ProductList.SelectedItem.Value )

Now in second page, same way remove all if conditions keep only following logic

Dim connectionstring As String = WebConfigurationManager.ConnectionStrings("Product_Details").ConnectionString

            Dim con As New SqlConnection(connectionstring)

            Dim selectsql As String = "SELECT Product_Name,Size,Price FROM Prod_Det WHERE Products='" & Product &"' ORDER BY Prod_Det"
            Dim cmd As New SqlCommand(selectsql, con)
            Dim adapter As New SqlDataAdapter(cmd)

            'Fill the dataset

            Dim ds As New DataSet()

            adapter.Fill(ds, "Prod_Det")

            'Perform Binding

            SearchResultGrid.DataSource = ds
            SearchResultGrid.DataBind()

Also I found that you design is not propert you are searching on base of product name. Actually you show use numeric id columns, because name may be same but ID will remain unique.
Remember one thing, YOUR CODE SHOULD NEVER ASSUME WHAT WOULD BE THE DATA IN DATABASE.

urtrivedi 276 Nearly a Posting Virtuoso

When You are looking in four search fields in same column (PROCESS), then AND will not work. You need to implode with OR. Same is applicable to AGE field. Separate age1, age2 with OR

Another thing I would like to mention there is no need to keep 4 fields. you can keep one field for one column, ultimately you are using PROCESS and AGE column so you need only 2 search fields not 6.

urtrivedi 276 Nearly a Posting Virtuoso

At your workplace, ask your IT department, whether they have php webserver, do they allow accessing ms sql server to that php webserver.
Instially you mentioned that you need to import excel to mssql, You did not mentioned that they are asking you to publish data on web.
to publish data you will definitely need php webserver.

Ask them can you keep data in mysql server. Because in that case you will find so many free mysql-php web server. Its difficult to find FREE mssql-php server.

urtrivedi 276 Nearly a Posting Virtuoso

First of all make your link proper, use common get parameter for all a to z links, Here i m using alpha get variable.

printf ('<a href = "%s?result.php?alpha=%s">%s</a> ', $PHP_SELF,chr($i) , chr($i));

Then in your result.php you query must look like

$query="select * from tablename where column like '{$_GET['alpha']}%'";
urtrivedi 276 Nearly a Posting Virtuoso

Your university told you how to write php code, but they might have not told you how to configure your database and webserver.

Now here at your workplace, I think there is no role of php. Microsoft will surely give you some option to import excel data directly to you mssql server. YOu may find some utility to do such operations. For now forget about php, start googling for import excel file in MSSQL (YOUR MSSQL VERSION)

urtrivedi 276 Nearly a Posting Virtuoso

Actually there is no difference, Its my own feeling, I prefer print_r. Otherwise most important part is using pre for displaying values in proper format.

urtrivedi 276 Nearly a Posting Virtuoso

Good design tries to facilitate processes and activities and to allow for as much freedom and variety as possible without compromising ease of use. It does not harm anyone to record day/hour/minute values instead of only days, except maybe the developer who may have to introduce a business rule which says: One book may be only retrieved once per day and user. If such a rule exists it will most probably exists because of "technical" reasons, i.e. bad design.
And well designed systems of course allow for exceptions. The other are the ones which drive us crazy at check-in terminals, ATMs, ticket vending machines and bureaucracy officials telling us of "technical reasons" why something is not possible.

I agree

urtrivedi 276 Nearly a Posting Virtuoso

mark it solved

urtrivedi 276 Nearly a Posting Virtuoso

dear friend mark this solved

urtrivedi 276 Nearly a Posting Virtuoso

I do not think practically some one would issue then return and issue again on same day. I think even library rules also may not allow such practice. This is an exception and I think exceptions are not included in systems.

urtrivedi 276 Nearly a Posting Virtuoso

your directory must look like following

webroot
|__________molham
             |________Connections
             |            |_________bdata.php
             |________edary.php

OR set proper path in line require_once(Connections/bdata.php), so that php can locate bdata.php

linux apache is case sensitive , so check the file spelling case in your diretories.

urtrivedi 276 Nearly a Posting Virtuoso

Better way to view your array is following, after setting your array, write following 3 lines at the end of your code.

echo "<pre>";
print_r($_SESSION['cart']);
echo "</pre>";
urtrivedi 276 Nearly a Posting Virtuoso

say your form in menu is

Entry
|____new Master

Here your menu newmaster will open a form for example,
We assue that name of ENTRY menu item is, ENT
AND name of new master menu item is NEWMST
so collectiveley we can say that new master menu item is ENT.NEWMST

Now we will have 4 table for example

usergroup (groupid, groupname,view, add , delete, edit, print) //here last 4 columns would be Y/N kind of columns
users (userid, groupid)
menu_master(menuid, menuname)
group_rights (menuid, groupid)

creat view which joins all above tables, to simply fetch information

You must track logged in userid,

Now in new form instance trigger, you may query your menuid and userid, to find add, delete, edit, print view flags)
or you may create database function with(menuid, userid, operation) which will return whether use has right of that operation or not.

urtrivedi 276 Nearly a Posting Virtuoso

Also add on more key that is autonumber say transaction ID.
To avoid duplication make combination of three columns as unique (cardnumber,libraryid,chekcoutdate)

checkout(trans_id,cardNumber,libraryID, checkoutDate, checkinDate, dueDate)

urtrivedi 276 Nearly a Posting Virtuoso

Visit following post and go through all comments, I think you will find proper solution

http://www.daniweb.com/web-development/php/threads/366629

urtrivedi 276 Nearly a Posting Virtuoso

i think you do not have null vales in your database. What you have is 'NULL' word in columns, thats why my query did not show any result.

So now you can remove such rows by following query

delete from tablename where TRIM(grade)='NULL'
urtrivedi 276 Nearly a Posting Virtuoso

If you follow in urtridevis direction you will still have to delete the color and image join clauses from your query. Removing the columns from the column list alone does not change the number of result set but only which columns are retrieved from it.

I think you have not read my queries. In first I am filtering records by color, and In second I am summing up the stock. So my queries resulting only 2 rows instead of 4.

For my database design, the query is wrong then. As I want to get all those columns, I should use two queries. This is what I understand.

First of all if you want all columns then You must find out are you interested in color of product or not. Because color table is the table which is multiplying your output. I think you are not sure what you want to show.

urtrivedi 276 Nearly a Posting Virtuoso

first select whether your table has null rows or not.
run following queries one by one.

SELECT name, grade, age FROM education 
WHERE (grade IS  NULL )

SELECT name, grade, age FROM education 
WHERE ( name is null )

SELECT name, grade, age FROM education 
WHERE (age is null)

see whether you get any row(s) (having null value)

urtrivedi 276 Nearly a Posting Virtuoso

You are expecting a solution but not following what people asking you to do. Have you read my previous post

http://www.daniweb.com/web-development/databases/oracle/threads/366673/1573429#post1573429

urtrivedi 276 Nearly a Posting Virtuoso

write first two lines shown below in code part, in the begining of your code and then try to run your page.

Also echo your query before inserting, copy that from browser, run that prepared query in your second database directly using phpmyadmin (or any other tool). Then check whether you are getting any error there or not.

<?php

error_reporting(E_ALL); 
ini_set("display_errors", 1);
        
$con1 = /*connect to server 1*/
$con2 = /*connect to server 2*/
.
.
.
.
$query="INSERT INTO table2 (col1, col2, col3, col4, col5)
		VALUES('$one','$two','$three','$four','$five')";
echo $query;

mysql_query($query, $con2)
	or die(mysql_error());

.
.
.

?>
urtrivedi 276 Nearly a Posting Virtuoso

write 2 lines after fecthing it from database and before using it anywhere. then see whether its coming as expected.

echo $symSymbol ;
echo $symName;

before you use them anywhere in the code

urtrivedi 276 Nearly a Posting Virtuoso

adding ot Smantscheff comments, YOu may filter rows by colour

SELECT
product.id AS ProductID,
product.code AS ProductCode,
product.description AS ProductDescription,
product.price AS ProductPrice,
product.vat AS ProductVat,
product.is_available AS ProductIsAvailable,
colour.id AS ProductColourID,
colour.colour AS ProductColour,
stock.stock AS ProductStock,
image.id AS ProductImageID,
CONCAT(image.name, '.jpg') AS ProductImage
FROM product
INNER JOIN colour ON product.id = colour.pk_product_id
INNER JOIN stock ON colour.id = stock.pk_colour_id
INNER JOIN image ON product.id = image.pk_product_id
where colour.colour='Black'

or you may remove color.color from column list

SELECT

product.id AS ProductID,
product.code AS ProductCode,
product.description AS ProductDescription,
product.price AS ProductPrice,
product.vat AS ProductVat,
product.is_available AS ProductIsAvailable,
image.id AS ProductImageID,
CONCAT(image.name, '.jpg') AS ProductImage,
sum(stock.stock) AS ProductStock

FROM product
INNER JOIN colour ON product.id = colour.pk_product_id
INNER JOIN stock ON colour.id = stock.pk_colour_id
INNER JOIN image ON product.id = image.pk_product_id
group by
product.id ,
product.code ,
product.description,
product.price ,
product.vat ,
product.is_available ,
image.id ,
CONCAT(image.name, '.jpg')
urtrivedi 276 Nearly a Posting Virtuoso

select * from mytable order by abs(mydate-sysdate)

urtrivedi 276 Nearly a Posting Virtuoso

you must keep those two lines under <?php tag

<?php
       error_reporting(E_ALL); 
	ini_set("display_errors", 1);
.
.
.
.
?>
urtrivedi 276 Nearly a Posting Virtuoso

on the begining of your page write this 2 lines and then run your page

error_reporting(E_ALL); 
	ini_set("display_errors", 1);
urtrivedi 276 Nearly a Posting Virtuoso

I was just giving credits nothing special.

urtrivedi 276 Nearly a Posting Virtuoso

I think you have already including

include ('require/dbUtil.inc');

in mysqli.inc, try to comment it.

urtrivedi 276 Nearly a Posting Virtuoso

I think problem is in your query`s line number 15 (your first post)

It should read

stock ON product.id = stock.pk_colour_id

instead of

stock ON colour.id = stock.pk_colour_id
urtrivedi 276 Nearly a Posting Virtuoso
$string= nl2br($string);
urtrivedi 276 Nearly a Posting Virtuoso

write two php files, one for showing all other data

file 1.php
1)fetch data from mysql with primary key
2) show all columns
3) <img src='file2.php?imgid=currid'>

file2.php //it will contain code you have written to show image in your post above, but it will use one get parameter to load specific single image.

$sql = "SELECT image,size,format FROM img_tbl where record_id='{$_GET['imgid']}'";
 
        // the result of the query
        $result = mysql_query($sql) or die("Invalid query: " . mysql_error());
 
        // Header for the image
        header("Content-type: image/jpeg");
        echo mysql_result($result, 0,'imageData');
geoamins2 commented: Thank You. this code was really helpful for me and for other who has same problem. +1
urtrivedi 276 Nearly a Posting Virtuoso

Following is the nice post by almostbob (member of this site). I hope this will help you.

http://www.daniweb.com/business-exchange/website-reviews/threads/366283/1571019#post1571019

urtrivedi 276 Nearly a Posting Virtuoso

THen its not the fault of query. If your images are multiple then it will show both.

urtrivedi 276 Nearly a Posting Virtuoso

You have 2 records for same (1) pk_product_id in image table.

INSERT INTO `image` VALUES ('1', '83d8f803-8c4c-11e0-a22a-0ef39922def5', '1');INSERT INTO `image` VALUES ('2', '10aae9f7-8c4f-11e0-a22a-0ef39922def5', '1');

urtrivedi 276 Nearly a Posting Virtuoso

\ this is used to escape a character.

if you want to substitute variable value in string then you must prepare string in double quotes as i did.

$name="mikcy";
$mymessage= "welcome $name";  //'welcome $name'  will not substitute name.
echo $mymessage;

//output is 
welcome micky

Now you want name to be printed in double quotes, then you can not directly use it in string. if you use directly then php will think its end of string, so we use escape character

$name="mikcy";
//$mymessage= "welcome "$name" ";  //this will not work
$mymessage= "welcome \"$name\" ";  //this will work
echo $mymessage;

//output is 
welcome "micky"

I hope its clear now, If yes then mark this thread solved

urtrivedi 276 Nearly a Posting Virtuoso
$filter=" where Customer.custNum=customerCar.custNum and customerCar.regno=booking.regno and customerCar.custNum=booking.custNum "
urtrivedi 276 Nearly a Posting Virtuoso

NO its not cumpulsory, but if you wish you can create relationship to avoid errneous records

urtrivedi 276 Nearly a Posting Virtuoso
myquery="INSERT INTO PR_REC(pr_no,item1,price1,qty1,item2,price2,qty2,item3,price3,qty3,item4,price4,qty4,item5,price5,qty5,item6,price6,qty6,item7,price7,qty7,item8,price8,qty8,item9,price9,qty9,item10,price10,qty10,Pur_reason,pr_date,Status) VALUES ('" & Me.txtprno.Text.TRIM & "','" & Me.txtitm1.Text.TRIM & "','" & Me.txtprc1.Text.TRIM & "', '" & Me.txtqty1.Text.TRIM & "','" & Me.txtitm2.Text.TRIM & "', '" & Me.txtprc2.Text.TRIM & "','" & Me.txtqty5.Text.TRIM & "','" & Me.txtitm3.Text.TRIM & "','" & Me.txtprc3.Text.TRIM & " ','" & Me.txtqty9.Text.TRIM & "','" & Me.txtitm4.Text.TRIM & " ','" & Me.txtprc4.Text.TRIM & " ','" & Me.txtqty2.Text.TRIM & "','" & Me.txtitm5.Text.TRIM & " ','" & Me.txtprc5.Text.TRIM & " ','" & Me.txtqty6.Text.TRIM & "','" & Me.txtitm6.Text.TRIM & " ','" & Me.txtprc6.Text.TRIM & " ','" & Me.txtqty6.Text.TRIM & "','" & Me.txtitm7.Text.TRIM & " ','" & Me.txtprc7.Text.TRIM & " ','" & Me.txtqty10.Text.TRIM & "','" & Me.txtitm8.Text.TRIM & " ','" & Me.txtprc8.Text.TRIM & " ','" & Me.txtqty3.Text.TRIM & "','" & Me.txtitm9.Text.TRIM & " ','" & Me.txtprc9.Text.TRIM & " ','" & Me.txtqty7.Text.TRIM & "','" & Me.txtitm10.Text.TRIM & " ','" & Me.txtprc10.Text.TRIM & " ','" & Me.txtqty11.Text.TRIM & "','" & Me.txtpr.Text.TRIM & "',to_date('" & textDateTime & "','mm/dd/yyyy hh24:mi:ss'),'" & ComboBox1.Text.TRIM & "')"

print myquery // keep break point here in dubugger

com = NEW OleDbCommand(myquery, con)

go to debugger, copy value of variable myquery and post it here.

urtrivedi 276 Nearly a Posting Virtuoso
<?php
    //replace line 19
    echo $comma."[\"$imagefolder/$imagefilename\", \"$imageurl\", \"_new\"]" ;

   //add new line 20
    $comma=", ";
?>
urtrivedi 276 Nearly a Posting Virtuoso

I told you, that you need to change following line according to your table design. I do not know how your tables are related to each other.

$filter=" where customer.custid=customercar.custid and customercar.regno=booking.regno "

Also post sql file of 3 tables only (used above customer, customerCar, booking ).
Do not send whole database structure here in text format. I need exported from phpmyadmin or atleast in sql format.

urtrivedi 276 Nearly a Posting Virtuoso

I have added .= operator, make that change above

if(strlen($familyname) > 0 )
    $filter.=" and familyName='$familyname' ";
else if(strlen($phonenumber) > 0 )
    $filter .= " and contact='$phonenumber' ";
else if(strlen($regno) > 0 )
    $filter .= " and booking.rego='$regno' ";
urtrivedi 276 Nearly a Posting Virtuoso

first remove first xml definition line
Then test below code in your environment.
also change join condition for customer, customerCar, booking in first $filter variable. otherwise you will get duplicated rows or error in result.

<!--?xml version="1.0" encoding="UTF-8"?-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
	<title>Aus AutoService - Find a Booking</title>
</head>
<body>
<?php
if(isset($_post["submit"]))
{
$familyname = $_POST('fName');
$phonenumber = $_POST('phNum');
$regno = $_POST('regNum');
$conn=mysql_connect("localhost","twastudent","prac3") or die(mysql_error());
mysql_select_db(autoservice, $conn) or die(mysql_error());

$filter=" where customer.custid=customercar.custid and customercar.regno=booking.regno ";

if(strlen($familyname) > 0 )
    $filter.=" and familyName='$familyname' ";
else if(strlen($phonenumber) > 0 )
    $filter = " and contact='$phonenumber' ";
else if(strlen($regno) > 0 )
    $filter = " and booking.rego='$regno' ";



$result1 = mysql_query("SELECT familyName, firstName, suburb, contact, rego, bookingDate FROM 
customer, customerCar, booking ($filter ) ORDER BY familyName, bookingDate");


}



?>
<form id="findBooking" method="post" action="findbooking.php">
<p>Please enter the appropriate data into one of the three fields below:</p>
<table border="0">
<tr>
<td>Family Name</td>
<td>Phone Number</td>
<td>Vehicle Registration Number</td>
</tr>
<tr>
<td><input type="text" name="fName"/></td>
<td><input type="text" name="phNum"/></td>
<td><input type="text" name="regNum"/></td>
</tr>
</table>
<table>
<?php
while ($row = mysql_fetch_array($result1)) { ?> 
<tr>
<td><?php echo $row["firstName"]?></td>
<td><?php echo $row["familyName"]?></td>
<td><?php echo $row["suburb"]?>td>
<td><?php echo $row["contact"]?></td>
<td><a href="BookingDetail.php=?regno=<?php echo $row["rego"]?>"><?php echo $row["rego"]?> </a></td>
<td><?php echo $row["bookingDate"]?></td>
</tr>
<?php }
mysql_close($conn); ?>


<input type="submit" value="log in" name="submit"/>
<input type="reset" />
</form>
</body>
</html>
urtrivedi 276 Nearly a Posting Virtuoso

post your table structure script with data, that are used in above page

urtrivedi 276 Nearly a Posting Virtuoso

having relationship is good thing to do in database, but it is not mandatory at all. You will not see much pk to pk relation (1 to 1). Generally you will find (pk-fk) kind of relation much in database.

urtrivedi 276 Nearly a Posting Virtuoso

1) You should not use there queries. Integrate there inputs in one query using OR operator. (you may also give one more dropdown with three text boxes that is AND, OR)

2) Same way to display you should not use three loops, just one is enough

3) for going to details page, You should use primary key of your view, Here I think its regno

urtrivedi 276 Nearly a Posting Virtuoso

your first html page

<form name=frm id=frm method=post action=showselected.php>
<img src='imga.jpg' ><checkbox name=chk id=chk value='imga.jpg'><br>
<img src='imgb.jpg' ><checkbox name=chk id=chk value='imgb.jpg'><br>
<img src='imgc.jpg' ><checkbox name=chk id=chk value='imgc.jpg'><br>
<img src='imgd.jpg' ><checkbox name=chk id=chk value='imgd.jpg'><br>
<img src='imge.jpg' ><checkbox name=chk id=chk value='imge.jpg'><br>

<input type=submit value=submit>
</form>

showselected.php

<?php
   $selcount=count($_POST['chk']);
   echo "YOu have selected following $selcount images:<br>";
   for($i=0;$i<$selcount;$i++)
   {
       echo $_POST['chk'][$i]."<br>";
   }
?>