Jump to content

microbert

Members
  • Posts

    32
  • Joined

  • Last visited

Posts posted by microbert

  1. 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?

     

  2. 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?

  3. 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>
    
  4. Hi,

     

    you all know that from phpmyadmin you can run an SQL Query for example "select * from table where code like '0011'"

     

    sqlquery.png

     

    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

  5. 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:
     

    If for example I am searching for "how to make a search" and I type "make a search" - it works fine but if It type "how to search" it doesn't work.


    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

     

  6. $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"

  7. Sorry about that.

     

    This is the result:

     

    Rows returned: 1

    Rows returned: 1

    Rows returned: 1

    Rows returned: 1

    Rows returned: 1

    Rows returned: 1

    Rows returned: 1

    Rows returned: 1

    Rows returned: 0

     

    there is a picture also attached

    post-98530-13482403426477_thumb.png

  8. 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.

  9. 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.

×
×
  • 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.