Jump to content

microbert

Members
  • Posts

    32
  • Joined

  • Last visited

Everything posted by microbert

  1. thank you all for your help, it worked fine. I used the css media functions and it worked perfect.
  2. I think that the best solution is the css media, but I never used it and couldn't make it work. does anyone has used this type of command before? how to choose which part of the code you will show on the page?
  3. Ok, i have tried to use @media but how can I include a php file depending on the screen size? I have 2 files: 1. footer.php 2. footer_mobile.php
  4. Hi, I am trying to make a page where the footer is loaded according to the screen size, so if someone is accessing the website via a tablet will be a footer, if it is from the computer, there will be another footer. my problem is that although it is recognizing the windows width, it is not changing the footer accordingly. this is my code: $width = "<script>document.write(window.innerWidth);</script>"; if ($width < 900) { include("footer_mobile.php"); } else { include("footer.php"); } for some reason it is always loading the else footer even though the windows with changes. I added echo"$width" ; and the result of the variable was fine. does anyone know what the problem is cause it is driving me crazy?
  5. And if I decide to make it an auto-complete - meaning that the result are display as a pop out menu? is that better ? and it is possible?
  6. It is for a Like query and it going to generate a new page with search result.
  7. Hi, I am trying to make an autocomplete search bar - so for example if want to search for "Sony D3256 Camera" and I type "Sony camera" in the search bar, it still suggest the "Sony D3256 Camera". The ones that I found on blogs and forums are the ones that shows the suggestion until you break the sequence of the name. I am using PHP and MySQL Is this possible, or cannot be done?
  8. can you please tell me what PDO is and how to use it? sorry but I am a beginner
  9. This is my code for the form: <form action="sqlquery.php" method="GET"> <textarea name="SQLquery" rows="20" cols="40"></textarea> <br /> <input type="submit" name="SQLexecute" value="Execute Query" style="height: 30px; width: 350px; font-size: 16px" /> </form> and this is the submit form: <!DOCTYPE HTML> <html> <body> <?php mysql_connect("server", "username", "password") or die("Error connecting to database: ".mysql_error()); ?> <table width="100%" cellspacing="0" cellpading="0" valign="top" border="0"> <tr> <td> <?php $query = $_GET['SQLquery']; if($query == "") { echo(" <table align='center' border='1' width='1000px' bgcolor='#FFFFFF'><tr> <td align='center' width='150px'> <font size='+2'>Opps! You forgot to enter query.</font> </td> </tr></table> "); } else { echo(" <table bgcolor='#FFF' align='center' border='1' width='1000px' cellspacing='0' cellpading='0'> <tr> <td align='center' width='150px'><b>Picture</b></td> <td align='center' width='530px'><b>Description</b></td> <td align='center' width='170px'><b>Stock</b></td> </tr> "); $sql = mysql_query("$query"); while($data = mysql_fetch_array($sql)) { $scode = $data['code']; $sname = $data['name']; $sqty = $data['qty']; $sDateModified = $data['DateModified']; $sDateCreated = $data['DateCreated']; include("ListView.php"); } $i--; $x++; } ?> </td> </tr> </table> </body> </html>
  10. I have tried that but it is giving me an error:
  11. Hi, you all know that from phpmyadmin you can run an SQL Query for example "select * from table where code like '0011'" now my question is can I add a query box like this directly into my website, so I can run a query without login into phpmyadmin? your help is very appreciated since I cannot make this happen. thanks
  12. To be fair I have tried to explode the keywords into an array and then run a look to make the sql command but it didn't work. I was hoping there is another way to make this work.
  13. My Database id InnoDB and it is not supported with FULLTEXT Search. Is there another way to do this?
  14. But is there a way to search word by word?
  15. Hi, I am trying to build a search page that searches MySQL database. I managed to do the search, but I have a small problem when giving the query. Ex: can someone help me out since I am loosing my mind on this. my sql command is: $SQL = mysql_query("SELECT * FROM stocks WHERE `name` LIKE '%$keywords%' order by code"); help is very appreciated
  16. $pieces is the data from the mysql field. this field it is has the item codes of the related items and they are seperated with a ";" in the one that I am testing it have 8 items. for example in the mysql filed it is as "code01;code02;code03;code04;code05;code06;code07;code08"
  17. So can you please tell me how can get more than one row from the query, because I am really stuck and can't find a solution.
  18. I really appreciate your help on this one, I have tried to modify some code but nothing is working. can you please give me an idea of how I need to change the while loop to display more than one result?
  19. Sorry about that. This is the result: there is a picture also attached
  20. it is diplaying them 1 in each row I wanted to make 5 columns and then a new row. here you can see the result:
  21. I thought so that the problem is somewhere there but could not find the problem. About the code I know that it is a nightmare but it was not written by me and I am not that good in coding php, so it is taking me a lot of time to figure what to change and how to change it.
  22. I am attaching the php file of that page. 18047_.php
  23. Hi, I am still trying to solve this problem, so if there are someone out there that have an idea of how can I solve it, please let me know i really need this. this is my latest version of the code: // define the number of columns per row $cols = 5; // start the counter $counter = 0; while ($row = mysql_fetch_array($retd)) { $code = $row["code"]; $name = $row["name"]; if ($counter % $cols == 0) { if ($counter > 0) { echo '</tr>'; } echo '<tr>'; } echo("<td width=150 align=center>"); echo ("<a href=../products/info.php?scode=$code><img src=pictures/$code.gif border=0 alt=Item $name</a>"); echo ("<br><a href=../products/info.php?scode=$code><span class=fs13>$name</span></a>"); echo("</td>"); //increment the counter $counter++; } This is a link to the problem that I have: The related items need to be 5 in every line. thanks in advance for your help.
  24. sorry about that I had the } missing, but in my original code it is there and yes the $counter++ is in the while loop.
  25. On my end it is generating this:
×
×
  • 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.