Jump to content

sk1tL1L

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

Posts posted by sk1tL1L

  1. Hello PHP Freaks!

    I am in need of some help, hopefully you guys can give me a hand.

     

    What I am trying to do is, create dynamic checkboxes which I have done and then put if they are ticket in a database. My current database layout is setout here: http://img204.imageshack.us/img204/9739/permstable.jpg

     

    And this is my form: http://img269.imageshack.us/img269/1186/addpagetable.jpg - the values under the button is the output from:

    foreach($_POST["perms"] as $value) {
    $test = explode("|", $value);
    echo $test['0']."|";
    echo $test['1']."<br />";
    }
    

     

    And a sample of my html:

    <td width="12.5%" align="center"><input type="checkbox" name="perms[]" value="5|view"></td>
    		<td width="12.5%" align="center"><input type="checkbox" name="perms[]" value="5|add"></td>
    		<td width="12.5%" align="center"><input type="checkbox" name="perms[]" value="5|edit"></td>
    		<td width="12.5%" align="center"><input type="checkbox" name="perms[]" value="5|delete"></td>
    

     

    the values are:

    groupid|permission

     

    What I need to do is put all those values (ticked or unticked) into the database layout I have but make it so its dynamic as in, if someone adds a new group, i won't have to modify the code.

     

    Thanks!

  2. Experience

    • PHP: 3 years
    • MySQL: 3 years
    • CSS: 1 years
    • XHTML: 1.5 years

     

    Job Information

    I can code anything small or medium in size, I work for a coding company which has just started. I'm coding a huge social networking application in PHP but I am looking for some extra work to make money. I will tell you the price when I hear from you.

     

    Contact Information

    You can contact me at stewart@scorerightservices.com

  3. Job Description

    I will install or uninstall any script / PHP application for you! I have 3 years PHP/MYSQL experience and can install nearly everything!

     

    Price

    I will charge anywhere from $15 - $60 USD depending on the script / application size.

     

    How to contact me

    Just give me an email at stewart@scorerightservices.com with the script name and i'll give you a price before I start.

  4. its still not working, i've even rebuilt the database.
    When i click submit on the form. It goes though but does not put the information from the form into the database. If there's something in that row it will be deleted eg.

    BEFORE FORM UPDATED
    __________________________________________
    | msn                                    |  icq              |
    |wowwowowwow@wow.com.au | 55674466      |
    _________________________________________

    AFTER
    _________________________________________
    | msn                                    |  icq              |
    |                                          | 55674466      |
    _________________________________________

    The MSN Field was updated, but the data was not inserted.
  5. The Code:
    [quote]<?php
    $email=$_POST['email'];
    $msn=$_POST['msn'];
    $icq=$_POST['icq'];
    $aim=$_POST['aim'];
    $avatar=$_POST['avatar'];
    $query = "UPDATE `user_system` SET `msn` = '$msn', `icq` = '$icq', `aim` = '$aim', email = '$email' WHERE `user_system`.`id` = '$member_id' LIMIT 1 ;";
    $result = mysql_query($query) or die("Problem with the query: $query<br>" . mysql_error());
    // if successfully updated.
    if($result){
    echo "Successful";
    echo "<BR>";
    echo "<a href='mc.php'>Back to Member Control</a>";
    }

    else {
    echo "Error! Please Try Again<br>";
    echo $result;
    }
    ?>[/quote]
    And it does not enter the data into the database, if i had something in the field already when i submit the update it does not work. The data from the form is not put into the database
  6. i'm creating a message system, and it keeps echoing "error" so i don't know what the prblem is!
    [code]<?php
    include ("config.php");
    $to=$_POST['username'];
    $message=$_POST['message'];

    // Insert data into mysql
    $sql="INSERT INTO messages(to, from, message)VALUES('$to', '$member', '$message')";
    $result=mysql_query($sql);

    if($result){
    echo "The PM has been sent to $to!";
    }

    else {
    echo "ERROR";
    }

    // close connection
    mysql_close();
    ?>[/code]
    [size=10pt][b][color=red]FIXED[/color][/b][/size]
  7. Hello, i've got abit of a problem
    [code]
      <?php
    include ("config.php");

    // Retrieve data from database
    $sql= "SELECT * FROM messages WHERE to='$member'";
    $result=mysql_query($sql);

    while($rows=mysql_fetch_array($result)){
    ?>
    <table width="400" border="1" cellspacing="0" cellpadding="3">
    <tr>
    <td width="10%"><? echo $rows['from']; ?></td>
    <td width="40%"><? echo $rows['message']; ?></td>

    </tr>
    </table>

    <?php
    }
    mysql_close();
    ?>[/code]

    Whic displays an error:
    [code]Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\xampp\xampp\htdocs\TFP\messages.php on line 51[/code]

    I'm Trying to make my own PM system, it will be great if you can help me with this.
  8. hey all i'm inserting this script to phpmyadmin:
    CREATE TABLE forum_posts (
    post_id int NOT NULL PRIMARY KEY AUTO_INCREMENT
    topic_id int NOT NULL,
    post_text text,
    post_create_time datetime,
    post_owner varchar( 150 )
    );

    and it is coming up with this error:
    #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 'topic_id int NOT NULL,
    post_text text,
    post_create_time datetime,
    post_owner ' at line 3

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