Jump to content

techker

Members
  • Posts

    812
  • Joined

  • Last visited

Posts posted by techker

  1. SQL query:

     

    CREATE TABLE WROX_SHOP_INVENTORY(

     

    ITEM_ID INTEGER UNSIGNED NOT NULL AUTO_INCREMENT ,

    ITEM_NAME VARCHAR( 100 ) NOT NULL ,

    ITEM_DESCRIPTION TEXT DEFAULT,

    PRICE DOUBLE( 5, 2 ) NOT NULL ,

    ITEM_IMAGE VARCHAR( 255 ) NOT NULL ,

    CATEGORY_ID INTEGER UNSIGNED NOT NULL ,

    PRIMARY KEY ( ITEM_ID ) ,

    FOREIGN KEY ( CATEGORY_ID ) REFERENCES WROX_SHOP_CATEGORY( CATEGORY_ID ) ON DELETE CASCADE

    ) ENGINE = InnoDB DEFAULT CHARACTER SET latin1 COLLATE latin1_general_cs_AUTO_INCREMENT =0

     

    MySQL said: 

     

    #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 '

    PRICE DOUBLE(5,2) NOT NULL,

    ITEM_IMAGE VARCHAR(255) NOT NULL,     

    CATEGORY' at line 4

     

    if i remove the''

  2. hey guys i got this from a book and it keeps on givving me erreurs on line 4

     

    CREATE TABLE WROX_SHOP_INVENTORY (

    ITEM_ID INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,

    ITEM_NAME VARCHAR(100) NOT NULL,

    ITEM_DESCRIPTION TEXT DEFAULT ‘’,

    PRICE DOUBLE(5,2) NOT NULL,

    ITEM_IMAGE VARCHAR(255) NOT NULL,     

    CATEGORY_ID INTEGER UNSIGNED NOT NULL,

     

      PRIMARY KEY (ITEM_ID),

     

    FOREIGN KEY (CATEGORY_ID)

        REFERENCES WROX_SHOP_CATEGORY(CATEGORY_ID)

        ON DELETE CASCADE

    )

     

    ENGINE=InnoDB DEFAULT CHARACTER SET latin1

          COLLATE latin1_general_cs_AUTO_INCREMENT=0

  3. hey guys i want to put an ajax tooltip(pop up box on mouse over)but i have already a mouse over on my image?

     

    like the tooltip goes like this

    <a href="#" onmouseover="ajax_showTooltip('demo-pages/js-calendar.html',this);return false" onmouseout="ajax_hideTooltip()"></a>

     

    but my button mouse over is already in there?how can i include that code in this?

    <a href="http://www.link.php" target="_blank" onMouseOver="MM_swapImage('Image65','','images/web2_0_over_06.jpg',1)" onMouseOut="MM_swapImgRestore()">

  4. SELECT c.NoCommande AS NoCommande, d.Quantite AS Quantite, c.UName AS Usager, c.DateCommande AS Date, p.SkuFabriquant AS Sku, p.DescriptionCourte AS NomProduit

    FROM tblCommande AS c

    LEFT JOIN (

    tblCommandeDetail AS d

    CROSS JOIN tblProduits AS p

    ) ON ( p.IDProduit = d.IDProduit

    AND d.NoCommande = c.NoCommande )

    WHERE c.UName = '$USERNAME'

    ORDER BY Date LIMIT 1 , 1  ");

     

    it is there?

  5. hey guys i was woundering if any body can point me in the right direction.

     

    so i have a database that store information of clients like when orders done in the shopping cart.so i recently made a box on the front page saying the last date the client ordered in the shopping cart.

     

    but he probleme im having is when there is nothing in there it gives no matches ..but the hole page gets messt up,even if i made it an include..

     

    here is the page that hase the query (the include page)

     

    <?php // Connects to your Database
    mysql_connect("localhost", "kk", "hhh") or die(mysql_error());
    mysql_select_db("hhh") or die(mysql_error());?>
    
    <?php
    $QQQ1 = mysql_query("SELECT c.NoCommande AS NoCommande, d.Quantite AS Quantite, c.UName AS Usager, c.DateCommande AS Date, p.SkuFabriquant AS Sku, p.DescriptionCourte AS NomProduit
    FROM tblCommande AS c
    LEFT JOIN (
    tblCommandeDetail AS d
    CROSS JOIN tblProduits AS p
    ) ON ( p.IDProduit = d.IDProduit
    AND d.NoCommande = c.NoCommande )
    WHERE c.UName = '$USERNAME'
    ORDER BY Date LIMIT 1 , 1  ");
    if(!$QQQ1) die(mysql_error());
    $err = mysql_num_rows($QQQ1);
    if($err == 0) die("No matches met your criteria.");?>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <style type="text/css">
    <!--
    
    .echo2 {
        color: 000000;
        text-decoration: none;
    } 
    
    -->
    </style>
    </head>
    
    <body>
    <?php while ($info=mysql_fetch_array($QQQ1)) {
                 
    		   echo "</b><br> </i>";
                   echo "<span class='echo2'>".$info['Date']."</span>";
    		    } ?>
    </body>
    </html>
    

     

    so it only put the last date.in the box i made.i don't know if im clear lol

     

     

  6. i got this that views the directory and lists the images name.now the only thing i need to know is to link the name to a delete file that hase the unlink function

     

    <?php
    
    $imgdir = './'; // the directory, where your images are stored
    $allowed_types = array('png','jpg','jpeg','gif'); // list of filetypes you want to show
    
    $dimg = opendir($imgdir);
    while($imgfile = readdir($dimg))
    {
      if(in_array(strtolower(substr($imgfile,-3)),$allowed_types))
      {
       $a_img[] = $imgfile;
       sort($a_img);
       reset ($a_img);
      } 
    }
    
    $totimg = count($a_img); // total image number
      
    for($x=0; $x < $totimg; $x++)
    {
      $size = getimagesize($imgdir.'/'.$a_img[$x]);
    
      // do whatever
      $halfwidth = ceil($size[0]/2);
      $halfheight = ceil($size[1]/2);
      echo 'name: '.$a_img[$x].' width: '.$size[0].' height: '.$size[1].'<br />';
    }
    
    ?>
    

     

    i need the link to echo the name of the file to delete.for the unlink to work

  7. hey guys i have a script that inserts info in a mysql database and moves an image to a directory and inserting the path in the db.(instead of using the database to store images)

     

    no the problem is that when you delete the query it does not delete the pic.so he is going to have a nasty accumulation of images after a couple of years..lol

     

    so i was wondering if somebody can tel me how or point me in the right direction to haw to make a script that will show the images in a directory and you can delete the unwanted pic..

  8. its not a query it only an delete image

    cause i insert the path of the image in the databse not the image it self.

     

    <?php
    include('connection.php'); 
    
    
    if(isset($_GET['bin_data']) && !empty($_GET['bin_data']))
    {
        $file = $_GET['bin_data'];
    
        echo "<p>Deleted $file<br />\n" .
             'You\'ll be redirected to Home Page after (4) Seconds<p>';
    
        echo '<meta http-equiv="Refresh" content="4;url=/marlon/photo/thumbs/delete_pic_tn.php?bin_data='.$file. '">';
    }
    else
    {
        echo "Error deleting $file";
    }
    
    ?>
    

  9. ok i got it deleteing but the funy thing is it says it deleted the pic but it still there?lol

     

    the redirecting does not work do

     

    echo '<meta http-equiv="Refresh" content="4;url=/marlon/photo/thumbs/delete_pic_tn.php?bin_data='.$info['bin_data'] . '">';
    

    Edit:

     

    ok i replace

    bin_data='.$info['bin_data'] . '">';

    by

    bin_data='.$file. '">';

     

    but it still does not delte.it says it does..

     

     

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