Jump to content

vinpkl

Members
  • Posts

    448
  • Joined

  • Last visited

Everything posted by vinpkl

  1. thats browser default behavior. cant be removed. vineet
  2. hi emopoops on clicking the submit button the validation works and shows the alert "enter cutout price". the page didnt refreshed. the value changes to "0.00" but i entered 500.00 in that field. vineet
  3. hi all a strange thing is happening i have two fields "new_cutout" and "new_price". they both are defined as float fields in mysql. i m updating their values and also validating them with javascript. If I enter "500.00" in new_cutout field and "0.00" in new_price field and press submit button then both the values of new_cutout field and new_price field changes to "0.00" automatically. not able to know why is the value of new_cutout changing to "0.00" automaticaly. Is the problem of javascript or float. <script language="javascript"> function validate() { if(document.form1.new_cutout.value='0.00') { alert("Enter new cutout price"); return false; } if(document.form1.new_price.value='0.00') { alert("Enter new price"); return false; } } </script> <form action="" method="post" enctype="multipart/form-data" name="form1" id="form1" onsubmit="return validate();"> <input type="text" name="new_cutout" id="new_cutout" /> <input name="new_price" type="text" id="new_price" /> <input type="submit" name="submit" id="submit" value="Modify Product Price" /></td> </form> <?php $msg=""; if(isset($_REQUEST['submit'])) { $new_cutout=$_REQUEST['new_cutout']; $new_price=$_REQUEST['new_price']; $qry="update product_table set cutout_price=$new_cutout, price=$new_price where product_id=$id"; if(mysql_query($qry)) { $msg="Product Price updated successfully"; } else $msg="Error updating product Price"; } ?> vineet
  4. r u seeing a black doted border or blue border. vineet
  5. hi all i need to convert a website which has static above 2000 articles into dynamic and add that data into database. one solution i know is copy and paste it manually. is there any other formula or solution to it. vineet
  6. HI PFMaBiSmAd Thanks for the reply. Its now showing both results. solved. vineet
  7. hi all this query works fine $qry_p="select * from product_table where category_name='Digital Cameras' AND status='Y'"; this query also works fine $qry_p="select * from product_table where category_name='Digital SLR Cameras' and status='Y'"; but when i want result of both categories means "Digital cameras" and "Digital SLR Cameras" then no result is found $qry_p="select * from product_table where category_name='Digital Cameras' AND category_name='Digital SLR Cameras' and status='Y'"; vineet
  8. hi all i would like your tips on how to manage the multiple sellers website. Like there will be 50 sellers on my website, so i will have to create 50 folders for each seller and create 50 admin sections for each seller. Or there will be one single seller admin section which will fetch and show data according to seller login id. what other things i have to keep in mind while creating multiple sellers website. vineet
  9. hi MadTechie thanks for explanation. but this script will prevent only direct downloading from url. that i understood. but if the token is corect then still the song will get download in temp folder and user can save it. Or with flash player the songs doesnt get downloaded in temp folder. Am i correct. vineet
  10. Hi madTechie I dont know much about flash player But you mean to say that the mp3 folder should not be inside root folder and flash player will look for an id of that mp3 file. i didnt understand the token. is it ID of the mp3 file. vineet
  11. hi Madtechie This is a good idea. If didnt find anyother solution then i have to follow it. vineet
  12. hi all i am start work on a music selling website in PHP. normally when we listen to music mp3 file it gets saved in temporary files of the browser from where people can save it. how can i stop the files from getting downloaded in the temp folder of browser. Please everybody tell your opinion otherwise it would be difuclt to start project. i m new to this kind of situation. vineet
  13. hi ignace "order by category_id" will fetch results acording to category. but i want to fetch results all dealers in one category and that i m able to do. what i want to ask is after fetching how can i change their order sequence. at My present i am able to set sequence with my below query. But if i have 30 dealers then i have repeat this same query 30 times and it wil make my code very lenghty. vineet <?php $leftqry="select * from dealer_table where category_id=1 and dealer_name='nokia'"; $leftresult=mysql_query($leftqry); $leftrow=mysql_fetch_array($leftresult); $category_id=$_REQUEST['category_id']; echo "<tr>"; echo "<td>" . "<a class='leftnav'>&raquo " .$leftrow['dealer_name']. "</a></td>"; echo "</tr>"; ?> vineet
  14. hi Russell Yes 'Changed Series' means 'Changed order'. means the dealer name entered at serial no. 1 will be at no. 5 and dealer name entered at serial no. 10 will be at no.2. so if i loop them in single query then they will display acording to the serial number they were entered. like the below code will display only one manufacturer 'Nokia' <?php $leftqry="select * from dealer_table where category_id=1 and dealer_name='nokia'"; $leftresult=mysql_query($leftqry); $leftrow=mysql_fetch_array($leftresult); $category_id=$_REQUEST['category_id']; echo "<tr>"; echo "<td>" . "<a class='leftnav'>&raquo " .$leftrow['dealer_name']. "</a></td>"; echo "</tr>"; ?> and below query will output all dealers acording to serial no. they were entered in database. <?php $leftqry="select * from dealer_table where category_id=1"; $leftresult=mysql_query($leftqry); while($leftrow=mysql_fetch_array($leftresult)) { $category_id=$_REQUEST['category_id']; echo "<tr>"; echo "<td>" . "<a class='leftnav'>&raquo " .$leftrow['dealer_name']. "</a></td>"; echo "</tr>"; } ?> now how will i change their serial no. or order sequence. vineet
  15. hi all i m creating navigation from database. There are around 30 dealers names entered in database like 1) Nokia 2) Samsung 3) sony continue till... 30) panasonic but the problem is that in the navigation the names will not be displayed according to series they were entered. So if i have to display the navigation according to changed series then i have to repeat this query 30 times. Is there any other way to display and change series but not repeating the query 30 times. vineet <?php $leftqry="select * from dealer_table where category_id=1 and dealer_name='nokia'"; $leftresult=mysql_query($leftqry); $leftrow=mysql_fetch_array($leftresult); $category_id=$_REQUEST['category_id']; echo "<tr>"; echo "<td>" . "<a class='leftnav'>&raquo " .$leftrow['dealer_name']. "</a></td>"; echo "</tr>"; ?>
  16. thanks zanus your both solutions works great. vineet
  17. hi zaus great solution. This time it did the trick. thanks a lot. vineet idk, I was glancing through the mysql doc on replace and though it was an actual command like SELECT or UPDATE, guess I was wrong...maybe this would work then SELECT * FROM product_table WHERE REPLACE(`product_name`,'-','') LIKE '%" . $keyword . "%' but if you did that you'd HAVE to strip the hyphen beforehand...AND the wildcards would be kind of redundant...depending on what you have in that field EDIT: or maybe... SELECT * FROM product_table WHERE REPLACE('".$keyword."','-','') LIKE REPLACE(`product_name`,'-','')
  18. Hi fenway both replace() and trim() are not removing hyphens from product_name while calling query. like if there is product name AC-3A and i enter keyword AC3A then while calling query the product name still remains AC-3A. Therefore both product name and keyword doesnt match and no result is found. vineet
  19. HI zanus now the error is gone but the no result is found. this the query echo SELECT * FROM product_table WHERE TRIM('-' FROM `product_name`) LIKE '%AC3A%' vineet
  20. hi fenway and zanus this is the query $query="SELECT * FROM product_table WHERE TRIM("-" FROM `product_name`) LIKE "%' . $keyword . '%''; $result=mysql_query($query); echo $query; This is the error Warning: Division by zero in E:\xampp\htdocs\custm\search.php on line 105 Warning: Division by zero in E:\xampp\htdocs\custm\search.php on line 105 0 Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in E:\xampp\htdocs\custm\search.php on line 116 vineet
  21. hi zanus this doesnt works. shows no result. vineet
  22. hi zanus In the starting of my post i have already written that i can strip the hyphens from keyword entered using str_replace. the question i asked was how to remove the hyphen from the product name already in the database while calling query. i dont want to remove the hyphen from the database. it should be there in database but while calling the query it should remove hyphen from product name. vineet
  23. hi suresh with the query i m not getting any error. Its showing result with AC-3A but its not showing result with AC3A. vineet
  24. hi suresh this query showed result corectly without any error. so what do i need to do in php. why it was not showing results in php. vineet
  25. Hi suresh i ran the query in mysql and recived error SELECT * FROM product_table WHERE product_name = REPLACE(AC-3A,'-','') or product_name LIKE '%$keyword%'; Error i received is #1054 - Unknown column 'AC' in 'where clause' vineet
×
×
  • 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.