Jump to content

dflow

Members
  • Posts

    631
  • Joined

  • Last visited

Everything posted by dflow

  1. k thanks solved problem on localhost but strange that i didnt get the connection error before
  2. output: Error: No database selected strange but there isn't an error connecting on the
  3. //adding did not help mysql_query($query);
  4. i have the following processing action for a form query DUMP output is: string(202) "INSERT INTO contactPO (Status, DateReceived, CustomerEmail, LastName, FirstName, PropertyID, fromdate, todate, nop) VALUES ('1', '24-08-2011', 'r', 'r', 'rrrrr', '12121', '27-10-2011', '30-10-2011','4')" but nothing is inserted <?php $con = mysql_connect("localhost","international",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_query("SET NAMES 'utf8'"); mysql_select_db("international", $con); // check which button was clicked // perform calculation if ($_POST['send']) { $query = sprintf("INSERT INTO contactPO (Status, DateReceived, CustomerEmail, LastName, FirstName, PropertyID, fromdate, todate, nop) VALUES ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s','%s')", mysql_real_escape_string($_POST['Status']), mysql_real_escape_string($_POST['DateReceived']), mysql_real_escape_string($_POST['CustomerEmail']), mysql_real_escape_string($_POST['LastName']), mysql_real_escape_string($_POST['FirstName']), mysql_real_escape_string($_POST['PropertyID']), mysql_real_escape_string($_POST['fromdate']), mysql_real_escape_string($_POST['todate']), mysql_real_escape_string($_POST['nop'])); var_dump($query ); //$url_success = "search-index.php?RID=".$_POST['RequestID'].""; $url_success = "search-index.php"; echo("<meta http-equiv = refresh content=6;url=".$url_success.">"); exit; mysql_close($con); } ?>
  5. i have a simple javascript i want to implement as text field witha datepicker onClick popup this is the html of the input type i want to use <input type="text" id="fromdate" name="fromdate" size="10" readonly onClick='setOrigin("from");' />
  6. //this is what I started off with SELECT * FROM `apartments` WHERE city_id IN ( 3, 4, 5 ) AND Description ='' and RIGHT(ID,(SELECT * FROM apartments WHERE ID IN (2,3))
  7. anyone have a link to a good ajax php based script to add/remove elements? i want to create a form where one can manage prices according to date ranges thanks
  8. but that would be telling the secret
  9. THANKS
  10. HI the DESC was a typo for Description i want to get a query that results in ID's ending with specific INTs (1,4,6,7) etc
  11. #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 0, 30' at line 5 SELECT * FROM `apartments` WHERE city_id IN ( 3, 4, 5 ) AND DESC ='' and RIGHT(ID,(SELECT * FROM apartments WHERE ID IN (2,3)) [code]
  12. could you guide me on how to implement it with the ajax?
  13. yep your test works fine but i still get nothing with the part i added to the check parameter , empty array
  14. adding it to the check parameter part doesn't work? // check the parameter if(isset($_GET['part']) and $_GET['part'] != '' and preg_match('/'. $_GET['part'] .'/i', $row['city_name']))
  15. thanks and in general for a whole list of cities?
  16. ok it works the problem was capital letters: how would i force to search :Amsterdam and amsterdam with preg_match?
  17. the demo code works as is; if i change the query $result = mysql_query("SELECT city_name FROM citylist"); i get no results in the autocomplete if i change the
  18. i have the following script from a demo that works: if i change the query to my db it only works with city_id as a number (response is [] for city_name //sql: CREATE TABLE `sks_color` ( `id` int(11) NOT NULL auto_increment, `name` varchar(255) collate latin1_general_ci NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=14 ; <?php $link = mysql_connect('localhost', 'dbUsername', 'dbPassword'); if (!$link) { die('Could not connect: ' . mysql_error()); } if (!mysql_select_db("database")) { echo "Unable to select mydbname: " . mysql_error(); exit; } $result = mysql_query("SELECT name FROM sks_color"); while ($row = mysql_fetch_assoc($result)) { $colors[]=$row['name']; } mysql_free_result($result); mysql_close($link); // check the parameter if(isset($_GET['part']) and $_GET['part'] != '') { // initialize the results array $results = array(); // search colors foreach($colors as $color) { // if it starts with 'part' add to results if( strpos($color, $_GET['part']) === 0 ){ $results[] = $color; } } // return the array as json with PHP 5.2 echo json_encode($results); } ?> my chamges //sql CREATE TABLE `citylist` ( `city_id` int(11) NOT NULL AUTO_INCREMENT, `country_id` int(11) NOT NULL, `city_name` varchar(200) NOT NULL, PRIMARY KEY (`city_id`), KEY `city_id` (`city_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=616 ; <?php $link = mysql_connect('localhost', 'root', 'root'); if (!$link) { die('Could not connect: ' . mysql_error()); } if (!mysql_select_db("international")) { echo "Unable to select mydbname: " . mysql_error(); exit; } $result = mysql_query("SELECT city_name FROM citylist"); while ($row = mysql_fetch_assoc($result)) { $colors[]=$row['city_name']; } mysql_free_result($result); mysql_close($link); // check the parameter if(isset($_GET['part']) and $_GET['part'] != '') { // initialize the results array $results = array(); // search colors foreach($colors as $color) { // if it starts with 'part' add to results if( strpos($color, $_GET['part']) === 0 ){ $results[] = $color; } } // return the array as json with PHP 5.2 echo json_encode($results); } ?> :confused:
  19. guys i found a resize sciprt on the fly i have a syntax question: how should i implement this: //<img src="/scripts/timthumb.php?src=/images/whatever.jpg&h=150&w=150&zc=1" alt="" /> into this script: //Add image $RsImage_list_tableHTML .= " <td width=\"88\">"; $RsImage_list_tableHTML .= "<a href=\"../../app-images/{$row_RsImage_image['ImageURL']}\""; $RsImage_list_tableHTML .= " rel=\"lightbox[{$row_RsImage_image['ID']}]\">"; $RsImage_list_tableHTML .= "<img src=\"../../app-images/{$row_RsImage_image['ImageURL']}\" width=\"88\" height=\"66\" border=\"0\"/>"; $RsImage_list_tableHTML .= "</a>"; $RsImage_list_tableHTML .= "</td>\n";
  20. yep same size
  21. i did didnt help if not working trying this
  22. i have the following script calling a list of images i would like to force image resize to width:500px for the gallery image //Add image $RsImage_list_tableHTML .= " <td width=\"88\">"; $RsImage_list_tableHTML .= "<a href=\"../../app-images/{$row_RsImage_image['ImageURL']}\""; $RsImage_list_tableHTML .= " rel=\"lightbox[{$row_RsImage_image['ID']}]\">"; $RsImage_list_tableHTML .= "<img src=\"../../app-images/{$row_RsImage_image['ImageURL']}\" width=\"88\" height=\"66\" border=\"0\"/>"; $RsImage_list_tableHTML .= "</a>"; $RsImage_list_tableHTML .= "</td>\n"; //lightbox css #lightbox{ position: absolute; left: 0; width: 100%; z-index: 100; text-align: center; line-height: 0;} #lightbox img{ width: 505px; height: auto;} #lightbox a img{ border: none; } #outerImageContainer{ position: relative; background-color: #fff; width: 250px; height: 250px; margin: 0 auto; } #imageContainer{ padding: 10px; } #loading{ position: absolute; top: 40%; left: 0%; height: 25%; width: 100%; text-align: center; line-height: 0; } #hoverNav{ position: absolute; top: 0; left: 0; height: 100%; width: 100%; z-index: 10; } #imageContainer>#hoverNav{ left: 0;} #hoverNav a{ outline: none;} #prevLink, #nextLink{ width: 49%; height: 100%; background-image: url(data:image/gif;base64,AAAA); /* Trick IE into showing hover */ display: block; } #prevLink { left: 0; float: left;} #nextLink { right: 0; float: right;} #prevLink:hover, #prevLink:visited:hover { background: url(../images/prevlabel.gif) left 15% no-repeat; } #nextLink:hover, #nextLink:visited:hover { background: url(../images/nextlabel.gif) right 15% no-repeat; } #imageDataContainer{ font: 10px Verdana, Helvetica, sans-serif; background-color: #fff; margin: 0 auto; line-height: 1.4em; overflow: auto; width: 100% ; } #imageData{ padding:0 10px; color: #666; } #imageData #imageDetails{ width: 70%; float: left; text-align: left; } #imageData #caption{ font-weight: bold; } #imageData #numberDisplay{ display: block; clear: left; padding-bottom: 1.0em; } #imageData #bottomNavClose{ width: 66px; float: right; padding-bottom: 0.7em; outline: none;} #overlay{ position: absolute; top: 0; left: 0; z-index: 90; width: 100%; height: 500px; background-color: #000; }
  23. ok got echoed but it isnt megred into as a text node im using LIBXML_NOCDATA
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.