Jump to content

cs.punk

Members
  • Posts

    437
  • Joined

  • Last visited

Posts posted by cs.punk

  1. ??? ??? ???

     

    Ok heres the code

    <?php
      
    $con = mysql_connect("localhost","root","");
    if (!$con)
      {
      die('Could not connect: ' . mysql_error());
      }
    mysql_select_db("firstdatabase", $con);
    
    
    $query = "SELECT * FROM shop_stock WHERE Item = ('$_POST[item]') ";
    $result = "mysql_query($con,$query)"
    or die ("Couldnt execute query select and where query.");
    
    $row = "mysql_fetch_array($result)";
    
    
    $sql = "INSERT INTO homepage_special(Item, Amount, ID)
    VALUES
    ( ($row['Item']),($row['Amount']),($row['ID']) )";
    if (!mysql_query($sql,$con))
      {
      die('Error: ' . mysql_error());
      }
    echo "1 record has been sucsessfuly added!";
    
    
    ?>
    

     

     

    What exactly must I insert into the

     

    $sql = "INSERT INTO homepage_special(Item, Amount, ID)
    VALUES
    ( ($row['Item']),($row['Amount']),($row['ID']) )";
    

     

    ?

  2. Ok yes but now to make a form for that and then the results must show on another page?... The best way I can think of is make another table, and just edit it on one page and on the homepage I just select * from the table.

     

    Any better way to do it?

     

    Cause say now you have 500 entries to show. Now you want to ad 10, are you gonna write all 510 entries? I think not lol...

     

    If anyone knows a better way or better 'rule' to do this please post it  :)

  3. LoL check it over and over. And I finally figured out the problem.

    <?php
    $con = mysql_connect("localhost","root","");
    if (!$con)
      {
      die('Could not connect: ' . mysql_error());
      }
    mysql_select_db("mydatabase", $con);
    
    mysql_query(" UPDATE stuff SET Amount = ('$_POST[amount]')
    WHERE Item = ('$_POST[item]') ");
    mysql_close($con);
    ?>
    

     

    All it needed was () brackets for the

    '$_POST[example]'

    .

     

     

    Thanks to everyone!

  4. Uhm somebody please tell me whats going on  here? MYSSL is Microsofts SQL database language?

     

    Whats V5 of mysql got to do with mysqi?

    They use mysqi commands in mysql?

     

    I am confussed here... All my stuff that I copied and pasted is MYSQL commands in MYSQL. But now reading on further with a e-book it shows mysqi commands in MYSQL ???

     

     

    It's like XHTML and HTML I never really knew what I was using cause both seem to be exactly the same?

  5. Uhm here the form is:

     

    
    <html>
    <body>
    <form action="update.php" method="post">
    Item: <input type="text" name="item" />
    Amount: <input type="text" name="amount" />
    <input type="submit" />
    </form>
    </body>
    </html>

     

    Now on the receivng end

    <?php
    $con = mysql_connect("localhost","root","sorry removed lol");
    if (!$con)
      {
      die('Could not connect: ' . mysql_error());
      }
    mysql_select_db("stock", $con);
    
    mysql_query("UPDATE stock SET amount = ''$_POST[amount]''
    WHERE item = '$_POST[item);
    mysql_close($con);
    ?>

     

  6. Ok I got a form that adds contents to a MYSQL table. But now I want one that updates/changes within the table. I used a HTML form and got something like change 'amount?'' WHERE '$_POST' = '$_POST' ... I just confused myself now... Nevermind that coding... But it does not work where I try to retrieve the forms (posts?)? But using a form is a bad thing right? How else can I change the contents within a MYSQL table?...

  7. But one would need somesort of license?... I mean it IS going throught to a bank's (server?) after all?...

     

    Whats the point in providing a fake email? Uhm no point but you could like send a email from somebody's email address without needing to know anything about it?... That means email is way way un-secure! Somebody could use my email address to send something to someone and that someone will think it's me! :(...

     

    Anyone figured out that examply.php file?

     

    And lastly, I don' see allot that can be done with php to (is design a good word?) your website, I find HTML quite uhm 'weak?'...

  8. Ok here the story begins once again...

     

    LONG LONG ago I tried reading throught PHP and MYSQL for dummies (I did have a lil knowlage of HTML)... But I got stuck at the first example... (which I have attached)... Whats going on there? It's a MISTAKE in a book like THAT?

     

    I see that they use a differentkind of " " " mine are straight while theres are upside commas lol...

     

     

    Now for my general questions....

     

    1. Build your own shopping cart? How on earth is that possible? You cant make your own? You could make it charge 10x the amount specified or something?

     

    2. I was reading about mysql querys etc... There is a way to make a form which will then go to PHP coding and into a MYSQL query to add something to a database right?

     

    3. I was readinbg HTML for Dummies 5th edition, and they talked about FoRms... Hows that possible with HTML? It's a static webpage?...

     

    4. When I made a forum and used SMF I supplied my email address to use as admin.. Now when I send a message to all members via my forum it shows it's sent from MY GMAIL address... Uhm how does it know it's MINE? I could write someones else's email in there lol.....

     

     

    Thats it.... Please, please and please help me.... I am new here too... And uhm I am a Dummie  :) :)

     

    [attachment deleted by admin]

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