
DSTR3
Members-
Posts
53 -
Joined
-
Last visited
DSTR3's Achievements

Member (2/5)
1
Reputation
-
Closer, but still not the image..... http://www.menuhead.net/PopUP/mouseover-popup/overthis.php <td><a href ='#' id='trigger'('$row[LocationPix]');><img src='http://www.menuhead.net/Images/Buttons/PShotClear.png'</td> $(function() { var moveLeft = 20; var moveDown = 10; $('a#trigger').hover(function(e) { $('div#pop-up').show(); }, function() { $('div#pop-up').hide(); }); $('a#trigger').mousemove(function(e) { $("div#pop-up").css('top', e.pageY + moveDown).css('left', e.pageX + moveLeft); }); }); Now how to get the picture?
- 5 replies
-
- php
- javascript
-
(and 1 more)
Tagged with:
-
Useless. You shouldn't let your dog answer the questions.
- 5 replies
-
- php
- javascript
-
(and 1 more)
Tagged with:
-
I am trying to do a mouseover/mouseout on an image in a table. Right now I have it working with Javascript. You click on the camera and the image comes up in a new window. However; I want to do it with a mouseover like this. http://www.menuhead.net/PopUP/mouseover-popup/over.php I know mouseover is client side so how would I do this with php. function newPopup(url) { popupWindow = window.open( url,'popUpWindow','height=300,width=300,left=10,top=10,resizable=no,scrollbars=no,toolbar=no,menubar=no,location=no,directories=no,status=no' ) } <td><a href=Javascript:newPopup('$row[LocationPix]');><img src='http://www.menuhead.net/Images/Buttons/PShotClear.png'</td> Thank you.
- 5 replies
-
- php
- javascript
-
(and 1 more)
Tagged with:
-
fenway. Here is the solution I came up with. First I take all of te records that meet the criteria and insert them into them into a temp table. Then I do a count of how many times the LcationID appears and compare that against the number options that were selected. Then I run the query with those that equal the number of selected options. See what you think. <form method="post" name="Critters" id="Critters"> <p align="center"> <select name> </select> <select name> </select> <select> </select> </p> <p align="center"> <select name="criteria[]" multiple="multiple"> <?php include("config.php"); ///////With Numbers///// //$sql = "SELECT DISTINCT DetailType AS type, DetailID, DetailName FROM tblDetails //ORDER BY DetailType, DetailName"; // $result = mysql_query($sql) or die(mysql_error()); // $prev=''; // while ($row = mysql_fetch_assoc($result)) { // if ($prev != $row['type']) { // if ($prev) echo "</optgroup>"; // echo "<optgroup label='{$row['type']}'>"; // $prev = $row['type']; // } // echo "<option value='".$row['DetailID']."'>".$row['DetailName']."</option>"; // } // echo "</optgroup>"; //Without Numbers///// //This builds the dropdown based on City, Area, and Cuisiner for the results_city.php file $sql = "SELECT DetailType AS type, DetailID, GROUP_CONCAT(DISTINCT DetailName ORDER BY DetailName ASC SEPARATOR '|') AS DetailName FROM tblDetails GROUP BY DetailType"; $result = mysql_query($sql) or die(mysql_error()); while ($row = mysql_fetch_assoc($result)){ { var_dump($row); } echo "<optgroup label='{$row['type']}'>"; $DetailNames = explode('|', $row['DetailName']); foreach($DetailNames as $DetailName) { echo "<option value='".$DetailName."'>".$DetailName."</option>"; } echo "</optgroup>"; } ?> </select> </p> <p align="center"><input type="submit" name="btnSearch" id="btnSearch" value=" SEARCH "></p> </form> <p> <?php //This is for the button/////////////////////////////////// if (isset ( $_POST ["btnSearch"] )) { echo "<br>Selected Options are :<br>"; $checked = $_POST ["criteria"]; $criteria = ""; $separator = ", "; for($i = 0; $i < count ( $checked ); $i ++) { echo " " . $checked [$i] . "<br/>"; if ($i == count ( $checked ) - 1) { $separator = ""; } $criteria = $criteria . "'" . $checked [$i] . "'" . $separator; } //This gives a count of the number of options that have been selected//////////////////////// $nchecked = count($checked); echo("<p>$nchecked filter(s) HEROselected:<br>"); for($i=0; $i < $nchecked; $i++) { echo($checked[$i] . "<br/>"); } echo("</p>"); //END COUNT//////////////////////////////////// echo "<br><br>"; echo $criteria . "<br><br>"; include "config.php"; $mysqlQuery = "INSERT into tblTemp (LocationID,DetailID,DetailName) SELECT tblLocDet.LocationID, tblLocDet.DetailID, tblDetails.DetailName FROM tblLocDet INNER JOIN tblDetails ON tblLocDet.DetailID = tblDetails.DetailID WHERE tblDetails.DetailName IN (" . $criteria . ");"; mysql_query($mysqlQuery); $mysqlQuery2 = "SELECT tblTemp.LocationID, tblRestaurants.RestName, CONCAT(tblLocations.StreetNumber,' ', tblLocations.Street) AS Address, tblLocations.Phone, tblLocations.Price, tblLocations.Rating FROM (tblRestaurants INNER JOIN tblLocations ON tblRestaurants.RestID = tblLocations.RestID) INNER JOIN tblTemp ON tblLocations.LocationID = tblTemp.LocationID GROUP BY tblTemp.LocationID HAVING Count(tblTemp.LocationID) = '$nchecked' ORDER BY tblRestaurants.RestName"; //$mysqlQuery2 = ("SELECT tblTemp.LocationID, Count(tblTemp.LocationID) AS CountOfLocationID // FROM tblTemp // GROUP BY tblTemp.LocationID // HAVING Count(tblTemp.LocationID) = '$nchecked'"); mysql_query($mysqlQuery2); if (! $rs = mysql_query ( $mysqlQuery2 )) { echo "Cannot parse query"; } elseif (mysql_num_rows ( $rs ) == 0) { echo "No records found"; } else { echo (mysql_error()); echo "<table id=\"myTable\" table width=\"710\" class=\"beautifuldata\" align=\"Left\" cellspacing=\"0\">\n"; echo "<thead>\n<tr>"; echo "<th>PLACE</th>"; echo "<th>ADDRESS</th>"; echo "<th>PHONE</th>"; echo "<th>PRICE</th>"; echo "<th>RATING</th>"; echo "</tr>\n</thead>\n"; while ( $row = mysql_fetch_array ( $rs ) ) { echo"<tr> <td><strong><a href='$row[RestPage]'>$row[RestName]</a></strong></td> <td>$row[Address]</td> <td>$row[Phone]</td> <td>$row[Price]</td> <td>$row[Rating]</td> </tr>\n"; } echo "</table><br />\n"; } $mysqlQuery3 = "DELETE FROM tblTemp"; mysql_query($mysqlQuery3); mysql_close (); } ?> </p> </body>
-
I'm done. This works! Thank you everyone. Especially you DavidAM. include "config.php"; $mysqlQuery = "INSERT into tblTemp (LocationID,DetailID,DetailName) SELECT tblLocDet.LocationID, tblLocDet.DetailID, tblDetails.DetailName FROM tblLocDet INNER JOIN tblDetails ON tblLocDet.DetailID = tblDetails.DetailID WHERE tblDetails.DetailName IN (" . $criteria . ");"; mysql_query($mysqlQuery); $mysqlQuery2 = ("SELECT tblTemp.LocationID, Count(tblTemp.LocationID) AS CountOfLocationID FROM tblTemp GROUP BY tblTemp.LocationID HAVING Count(tblTemp.LocationID) = '$nchecked'"); mysql_query($mysqlQuery2); if (! $rs = mysql_query ( $mysqlQuery2 )) { echo "Cannot parse query"; } elseif (mysql_num_rows ( $rs ) == 0) { echo "No records found"; } else { echo (mysql_error()); echo "<table id=\"myTable\" table width=\"710\" class=\"beautifuldata\" align=\"Left\" cellspacing=\"0\">\n"; echo "<thead>\n<tr>"; echo "<th>PLACE</th>"; echo "<th>ADDRESS</th>"; echo "<th>PHONE</th>"; echo "<th>PRICE</th>"; echo "<th>RATING</th>"; echo "</tr>\n</thead>\n"; while ( $row = mysql_fetch_array ( $rs ) ) { echo"<tr> <td><strong><a href='$row[RestPage]'>$row[RestName]</a></strong></td> <td>$row[LocationID]</td> <td>$row[Phone]</td> <td>$row[Price]</td> <td>$row[Rating]</td> </tr>\n"; } echo "</table><br />\n"; } $mysqlQuery3 = "DELETE FROM tblTemp"; mysql_query($mysqlQuery3); mysql_close (); } ?>
-
OK this is all setup but still getting the error message cannot parse query. I run the query2 in Navicat and the recorda come up fine. The only thing that I am changing is the variable '$nchecked' I even tried a constant, the same that I am using in Navicat and I get the Error 'Cannot Parse Query"..... include "config.php"; $mysqlQuery = "INSERT into tblTemp (LocationID,DetailID,DetailName) SELECT tblLocDet.LocationID, tblLocDet.DetailID, tblDetails.DetailName FROM tblLocDet INNER JOIN tblDetails ON tblLocDet.DetailID = tblDetails.DetailID WHERE tblDetails.DetailName IN (" . $criteria . ");"; mysql_query($mysqlQuery); if (! $rs = mysql_query ( $mysqlQuery2 )) { echo "Cannot parse query"; } elseif (mysql_num_rows ( $rs ) == 0) { echo "No records found"; } else { $mysqlQuery2 = ("SELECT tblTemp.LocationID, Count(tblTemp.LocationID) AS CountOfLocationID FROM tblTemp GROUP BY tblTemp.LocationID HAVING Count(tblTemp.LocationID) == '$nchecked'"); mysql_query($mysqlQuery2); die (mysql_error()); echo "<table id=\"myTable\" table width=\"710\" class=\"beautifuldata\" align=\"Left\" cellspacing=\"0\">\n"; echo "<thead>\n<tr>"; echo "<th>LocationID</th>"; echo "</tr>\n</thead>\n"; while ( $row = mysql_fetch_array ( $rs ) ) { echo "<td>" . $row ['LocationID'] . "</td>"; echo "</tr>"; } } echo "</table><br />\n"; //$mysqlQuery3 = "DELETE FROM tblTemp"; //mysql_query($mysqlQuery3); mysql_close (); } ?>
-
OK I did it.....still no go. Message now is cannot parse query. The warning is gone. I suppose its down to that variable &nchecked.? if (! $rs = mysql_query ( $mysqlQuery2 )) { echo "Cannot parse query"; } elseif (mysql_num_rows ( $rs ) == 0) { echo "No records found"; } else { $mysqlQuery2 = ("SELECT tblTemp.LocationID, Count(tblTemp.LocationID) AS CountOfLocationID FROM tblTemp GROUP BY tblTemp.LocationID HAVING Count(tblTemp.LocationID) == '$nchecked'"); mysql_query($mysqlQuery2); echo mysql_error($mysqlQuery2);
-
Tried to place this earlier. Couldn't for some reason. <?php //This is for the button/////////////////////////////////// if (isset ( $_POST ["btnSearch"] )) { echo "<br>Selected Options are :<br>"; $checked = $_POST ["criteria"]; $criteria = ""; $separator = ", "; for($i = 0; $i < count ( $checked ); $i ++) { echo " " . $checked [$i] . "<br/>"; if ($i == count ( $checked ) - 1) { $separator = ""; } $criteria = $criteria . "'" . $checked [$i] . "'" . $separator; } //This gives a count of the number of options that have been selected//////////////////////// $nchecked = count($checked); echo("<p>$nchecked filter(s) HEROselected:<br>"); for($i=0; $i < $nchecked; $i++) { echo($checked[$i] . "<br/>"); } echo("</p>"); //END COUNT//////////////////////////////////// echo "<br><br>"; echo $criteria . "<br><br>"; include "config.php"; $mysqlQuery = "INSERT into tblTemp (LocationID,DetailID,DetailName) SELECT tblLocDet.LocationID, tblLocDet.DetailID, tblDetails.DetailName FROM tblLocDet INNER JOIN tblDetails ON tblLocDet.DetailID = tblDetails.DetailID WHERE tblDetails.DetailName IN (" . $criteria . ");"; if (! $rs = mysql_query ( $mysqlQuery )) { echo "Cannot parse query"; } elseif (mysql_num_rows ( $rs ) == 0) { echo "No records found"; } else { $mysqlQuery2 = ("SELECT tblTemp.LocationID, Count(tblTemp.LocationID) AS CountOfLocationID FROM tblTemp GROUP BY tblTemp.LocationID HAVING Count(tblTemp.LocationID) == 2"); mysql_query($mysqlQuery2); echo "<table id=\"myTable\" table width=\"710\" class=\"beautifuldata\" align=\"Left\" cellspacing=\"0\">\n"; echo "<thead>\n<tr>"; echo "<th>LocationID</th>"; echo "</tr>\n</thead>\n"; while ( $row = mysql_fetch_array ( $rs ) ) { echo "<td>" . $row ['LocationID'] . "</td>"; echo "</tr>"; } } echo "</table><br />\n"; //$mysqlQuery3 = "DELETE FROM tblTemp"; //mysql_query($mysqlQuery3); mysql_close (); } ?> </p> Still getting this....... Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/content/d/s/t/dstr3/html/MENUHEAD/Steelers/Czeh.php on line 98 No records found
-
I tried a constant in the second query and it still did not select the records. The insert and the delete query are working fine.
-
OK, Being new could you please show me where to place mysql_query($mysqlQuery) thank you.
-
So that is why it is working when I move it down! So it must be the variable $nchecked. But also I think its the mysql_numrows perhaps. At this point now. <?php //This is for the button/////////////////////////////////// if (isset ( $_POST ["btnSearch"] )) { echo "<br>Selected Options are :<br>"; $checked = $_POST ["criteria"]; $criteria = ""; $separator = ", "; for($i = 0; $i < count ( $checked ); $i ++) { echo " " . $checked [$i] . "<br/>"; if ($i == count ( $checked ) - 1) { $separator = ""; } $criteria = $criteria . "'" . $checked [$i] . "'" . $separator; } //This gives a count of the number of options that have been selected//////////////////////// $nchecked = count($checked); echo("<p>$nchecked filter(s) HEROselected:<br>"); for($i=0; $i < $nchecked; $i++) { echo($checked[$i] . "<br/>"); } echo("</p>"); //END COUNT//////////////////////////////////// echo "<br><br>"; echo $criteria . "<br><br>"; include "config.php"; $mysqlQuery = "INSERT into tblTemp (LocationID,DetailID,DetailName) SELECT tblLocDet.LocationID, tblLocDet.DetailID, tblDetails.DetailName FROM tblLocDet INNER JOIN tblDetails ON tblLocDet.DetailID = tblDetails.DetailID WHERE tblDetails.DetailName IN (" . $criteria . ");"; if (! $rs = mysql_query ( $mysqlQuery )) { echo "Cannot parse query"; } elseif (mysql_num_rows ( $rs ) == 0) { echo "No records found"; } else { $mysqlQuery = ("SELECT tblTemp.LocationID, Count(tblTemp.LocationID) AS CountOfLocationID FROM tblTemp GROUP BY tblTemp.LocationID HAVING Count(tblTemp.LocationID) == '$nchecked'"); echo "<table id=\"myTable\" table width=\"710\" class=\"beautifuldata\" align=\"Left\" cellspacing=\"0\">\n"; echo "<thead>\n<tr>"; echo "<th>LocationID</th>"; echo "</tr>\n</thead>\n"; while ( $row = mysql_fetch_array ( $rs ) ) { echo "<td>" . $row ['LocationID'] . "</td>"; echo "</tr>"; } } echo "</table><br />\n"; //$mysqlQuery3 = "DELETE FROM tblTemp"; mysql_close (); } ?> </p> </body> </html>
-
Barand Don't worry about that. I'll adjust the query later. I had it coughing out LocationID earlier. Don't know why it stopped. It's either the position of the queries, the naming of the queries or the variable. If ypu want I can change those output fields. kicken the complete message. Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/content/d/s/t/dstr3/html/MENUHEAD/Steelers/Czeh.php on line 96
-
Moving things around a bit, I have the first one working, However; the second query has yet to return any results. I made it == cause it has to be equal. not less than or greater than, but equal. Also receiving an ERROR on the line """ elseif (mysql_num_rows ( $rs ) == 0) {""" saying it's not valid. include "config.php"; $mysqlQuery = "INSERT into tblTemp (LocationID,DetailID,DetailName) SELECT tblLocDet.LocationID, tblLocDet.DetailID, tblDetails.DetailName FROM tblLocDet INNER JOIN tblDetails ON tblLocDet.DetailID = tblDetails.DetailID WHERE tblDetails.DetailName IN (" . $criteria . ");"; if (! $rs = mysql_query ( $mysqlQuery )) { echo "Cannot parse query"; } elseif (mysql_num_rows ( $rs ) == 0) { echo "No records found"; } else { $mysqlQuery = ("SELECT tblTemp.LocationID, Count(tblTemp.LocationID) AS CountOfLocationID FROM tblTemp GROUP BY tblTemp.LocationID HAVING Count(tblTemp.LocationID) == '$nchecked'"); echo "<table id=\"myTable\" table width=\"710\" class=\"beautifuldata\" align=\"Left\" cellspacing=\"0\">\n"; echo "<thead>\n<tr>"; echo "<th>PLACE</th>"; echo "<th>ADDRESS</th>"; echo "<th>PHONE</th>"; echo "<th>PRICE</th>"; echo "<th>RATING</th>"; echo "</tr>\n</thead>\n"; while ( $row = mysql_fetch_array ( $rs ) ) { echo "<tr><td><strong><a href='" . $row [RestPage] . "'>" . $row ['RestName'] . "</a> </strong></td>"; echo "<td>" . $row ['LocationID'] . "</td>"; echo "<td>" . $row ['Phone'] . "</td>"; echo "<td>" . $row ['Price'] . "</td>"; echo "<td>" . $row ['Rating'] . "</td>"; echo "</tr>"; } } echo "</table><br />\n"; //$mysqlQuery = "DELETE FROM tblTemp"; mysql_close (); } ?>
-
The first one that inserts the records to tblTemp only works if I REM out the second query. The SELECT query.
-
Your right! First its suppose to insert records into tblTemp. Its not. Next its suppose to Select records and return the results. its not. Third, its suppose to delete the records from the tblTemp. Its not. Pretty well broke I'd say. I would appreciate your help in this. From what I gather you are VERY knowledgable. Thank you. PS you were right about this...HAVING Count(tblTemp.LocationID) >= $nchecked