patk570 42 Newbie Poster

Hello,

I have one input field that is collecting some information like this:

<label>Tax Rate</label><br><input type="text" class="input" name="taxrate" id="taxrate" onblur=" return getTaxrate()"  value="<? echo $row['taxrate'] ?>">

what I am wanting to do is onblur convert from say 7.63 to .0763 for the tax rate.

I am only using one input field for this.

The JS I tried to use:

<script type="text/javascript">
function  getTaxrate() {
var gettax = document.getElementById('taxrate').value;
    {
    ans = (gettax * 100);
    outp = ans;
    }
  document.getElementById('taxrate').innerHTML = outp;
    } 
</script>

how can I get it to overwrite or automatically convert this?

patk570 42 Newbie Poster

Its a global variable for the site based of where I am.

Anyways, i got it fixed and made it way easier to use.

<label>Time Zone:</label><select name="timezone">
<?
$timezns = timezone_identifiers_list();
foreach ($timezns as $timezn) {
echo '<option';
if ( $timezn == $row['timezn'] ) echo ' selected';
echo ' value="' . $timezn . '">' . $timezn . '</option>' . "\n";
}
?>
</select>
patk570 42 Newbie Poster

I tried to use

<?php
    $dbValue= $row['timezn'];
    foreach($o as $tz => $label)
    $selected = ($tz == $dbValue ? "selected='selected'" : "");
    {
        echo "<option $selected value=".$tz.">$label</option>";
    }
?>

but all it submits back to me is zulu +0:00 when in the db it is America/Denver

patk570 42 Newbie Poster

Hi Everyone, I have a timezone variable that is stored in my database. In my code, I have it generate every timezone there is but what I need is to have it return the results of the selected="selected" when you go to pull the edit page up so you dont have to search 100's of different timezones to get yours again..

Here is the timezone code that I found:

<?php

function get_timezones()
{
    $o = array();

    $t_zones = timezone_identifiers_list();

    foreach($t_zones as $a)
    {
        $t = '';

        try
        {
            //this throws exception for 'US/Pacific-New'
            $zone = new DateTimeZone($a);

            $seconds = $zone->getOffset( new DateTime("now" , $zone) );
            $hours = sprintf( "%+02d" , intval($seconds/3600));
            $minutes = sprintf( "%02d" , ($seconds%3600)/60 );

            $t = $a ."  [ $hours:$minutes ]" ;

            $o[$a] = $t;
        }

        //exceptions must be catched, else a blank page
        catch(Exception $e)
        {
            //die("Exception : " . $e->getMessage() . '<br />');
            //what to do in catch ? , nothing just relax
        }
    }

    ksort($o);

    return $o;
}

$o = get_timezones();
?>

and to display the results:

<label>Timezone</label>
<select class="input" name="timezone">
<?php
    foreach($o as $tz => $label)

    {
        echo "<option value=".$tz.">$label</option>";
    }
?>
</select><br><br>

I need for the selected to go here somehow:

<label>Timezone</label>
<select class="input" name="timezone">
<?php
    foreach($o as $tz => $label)

    {
        echo "<option selected='selected' value=".$tz.">$label</option>";
    }
?>
</select><br><br>
patk570 42 Newbie Poster

Thanks, Sorry it took so long to get back.

patk570 42 Newbie Poster

and it did work. THanks again.

patk570 42 Newbie Poster

DAMMIT, lol that is so obvious. I cannot beleive that i missed that. I did it below but forgot that one.

patk570 42 Newbie Poster

I created a change password script and it seems to not want to work.

when I put in the wrong password it doesnt error out and say Old Password doesn't match exisiting.

when I put in 2 passwords that dont match it doesnt error out...

if(isset($_POST['changepass'])){
    //Getting Variables

    $oldpass = $_POST['oldpass'];
    $newpass = $_POST['newpass'];
    $conpass = $_POST['conpass'];
    $oldpass1 = sha1($oldpass);
    $pass = sha1($newpass);
    //check exisiting password matches
    if(!$oldpass){
        $passmsg = "Please Enter Password";
    }else{
    $query = "SELECT * FROM admin WHERE id='$id'";
    $result=mysql_query($query);
    $row=mysql_fetch_array($result);
    if($oldpass1 = $row['passcode']){
        //Check new password and confirm passwords match
        if ($newpass == $conpass) {
                //Update the database
                $sql = mysql_query("UPDATE admin SET passcode='$pass' WHERE id = '$id'")or die (mysql_error());
                $to = "$email";
                $additionalheaders = 'MIME-Version: 1.0' . "\r\n";
                $additionalheaders .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
                $additionalheaders .= "From: Patrick's Computer Repair Inc.\r\n";
                $additionalheaders .= "Reply-To: noprely@patrickspcrepair.com";
                $subject = "Your password has been changed";
                $body = "<html><body>"."\n";
                $body .= "Hi $login_session, <br /><br /> You or someone else has recently changed your password. <br />If you did not request this change, please contact us immedately at support@patrickspcrepair.com <br /><br />Your username is $user <br /><br />Regards, <br /><br /><img style=\"border:none; text-decoration:none;\" src=\"http://patrickspcrepair.com/portal/images/logo.gif\" alt=\"Patrick\'s Computer Repair Inc.\" /> ";
                $body .= "</html></body>"."\n";
                mail($to, $subject, $body, $additionalheaders);
                $passmsg = 'Your password has been changed.  Please logout and back in.';
                    }else{
                $passmsg = 'Passwords do not match';
                    }
    }else{
        $passmsg = "Old password is incorrect";
    }
    }
}
patk570 42 Newbie Poster
$cid = $con->insert_id;

is all i needed to do for them to work...

patk570 42 Newbie Poster

I understand I am using $_POST and not mysqli_real_escape_string(con, $_POST['fname']) right now this is not in production as of yet. On the form there is a login box that if they already been in once they get a username and password generated automatically and sent in the email. what I sent was just the input statements that I cannot figure out. THe ticket number is a randomly generated number that is 6 digits long and gets submitted to them so they can check the status online.

I am just wondering if it is possible to get A) the id's to match up like I need because the CID is what links their data together so they dont have multiple username and such. B) if the method I am using can be shortened?

Thanks,

patk570 42 Newbie Poster

Hello, I am trying to update 3 tables that i have in my db. the second and third INSERT commands there is a specific field that needs to have the ID of the first table last row inserted.

    first table, admin:
    +--------------------+
    |id username passcode|
    |1  admin    test    |
    +--------------------+

    second table custcomp
    +--------------------+
    |id cid cpuname sn   |
    |1  1   test    test |
    +--------------------+

    third table computerdb
    +--------------------+
    |id cid cpid ticket  |
    |1  1   1    123456  |
    +--------------------+

Now the CID needs to be the same in all fields which is the id(auto_increment) of the user in admin.

The CPID needs to be the id(auto_increment) of custcomp table

In my code i have $con->insert_id which works for the first one, but the CPID

Here is my input codes:

$con = mysqli_connect("localhost","ROOT","ROOT","MY_DB");
                       if (mysqli_connect_errno())
                               {
                                      echo "Failed to connect to MySQL:" . mysqli_connect_error();
                               }
                               $query = "INSERT INTO admin(name, email, phone, username, passcode, access_level) VALUES ('".$_POST['name']."','".$_POST['email']."','".$_POST['phone']."','".$username."','".$db_password."', '1')";
                               if (!mysqli_query($con,$query))
                        {
                             die('Error: ' . mysqli_error($con));
                        }else{

                        $sql2 = "INSERT INTO custcomp (cid, cpuname, sn, model, brand, hdd, memory, type )
                       VALUES ('".$con->insert_id."','Pending Update','N/A', 'Pending Update', 'Pending Update', 'Pending Update', 'Pending Update', 'Pending Update')";
                       if (!mysqli_query($con,$sql2))
                        {
                             die('Error: ' . mysqli_error($con));
                        }else{
                       $sql = "INSERT INTO computerdb (cpid, cid, ticket, computerpass, status, notes )
                       VALUES ('".$con->insert_id."','".$con->insert_id."','".$_POST['ticketnumber']."','".$_POST['password']."', 'Pending', '".date('m/d/Y H:i:s'). ": Work has started on your computer')";
                       if (!mysqli_query($con,$sql))
                        {
                             die('Error: ' . mysqli_error($con));
                        }else{

                            //more code to email info:

I think I might have gotten in over my …

patk570 42 Newbie Poster

I fixed it...
here is my updated code with SHA1 in it...

<?php
include("config.php");
session_start();
if($_SERVER["REQUEST_METHOD"] == "POST")
{
$errmsg = '';
// username and password sent from Form
    //$myusername=$_POST['username'];
    //$mypassword=$_POST['password'];

    $myusername=addslashes($_POST['username']);
    $mypassword=addslashes($_POST['password']);

// To protect MySQL injection (more detail about MySQL injection)
    $myusername = mysql_real_escape_string($myusername);
    $mypassword = mysql_real_escape_string($mypassword);


    $shapass = sha1($mypassword);
    if( $myusername == ''){
                $errmsg = 'Error: Please enter your username';
            }else{
        /*if($md5pass == ''){
                $errmsg = 'Error: Please enter your password';
            }else{*/

        $sql="SELECT id FROM admin WHERE username='$myusername' and passcode='$shapass'";
        $result=mysql_query($sql);
        $row=mysql_fetch_array($result);
        $active=
        $count=mysql_num_rows($result);


// If result matched $myusername and $mypassword, table row must be 1 row
        if($count==1)
    {
        session_register("username");
        $_SESSION['login_user']=$myusername;
        header("location: index.php");
    }
        else
    {
        $errmsg = "Error: your Username or Password is invalid. <br /> If you haven't registered yet, you can <a href='register.php'>register here</a>";
                }
            }
        }
?>
patk570 42 Newbie Poster

I fugured out one error. In the damn table, i had the the character limit set to 30...ugh I am a dummy... bit it is still not letting me login.

patk570 42 Newbie Poster

the password I did directly from the PHPMYADMIN table. I have the real escape string up top there for the password, but only there for a formality to prevent injection. I also change it directly to reflect what is being echoed but it still will not let me log in.

patk570 42 Newbie Poster

Its echoing: ************4b9d
in the db its: ************2b4b

the rest of the digits match....

patk570 42 Newbie Poster

ok, the last 4 digits of the code are not matching...

patk570 42 Newbie Poster

The statement does not throw out an error after adding this.

patk570 42 Newbie Poster

Hello,
I have a login script that I created and for some weird reason when it is in plaintext it works, but as soon as I put md5() it errors out and will not let me log in at all.

<?php
session_start();
error_reporting(E_ALL);
ini_set("display_errors", 1);
include("config.php");
if($_SERVER["REQUEST_METHOD"] == "POST")
    {
    $errmsg = '';
// username and password sent from Form
    $username=$_POST['username'];
    $password=$_POST['password'];

// To protect MySQL injection 
    $username = mysql_real_escape_string($username);
    $password = mysql_real_escape_string($password);


    $md5pass = md5($password);

        if( $username == ''){
                $errmsg = 'Error: Please enter your username';
            }else{
        if($md5pass == ''){
                $errmsg = 'Error: Please enter your password';
            }else{

        $sql="SELECT id FROM admin WHERE username='$username' and passcode= ' $md5pass '";
        $result=mysql_query($sql);
        $row=mysql_fetch_array($result);
        $count=mysql_num_rows($result);


// If result matched $username and $md5pass, table row must be 1 row
        if($count==1)
    {
        session_register("username");
        $_SESSION['login_user']=$username;

        header("location: index.php");
    }
        else
    {
        $errmsg = "Error: your Username or Password is invalid. <br /> If you haven't registered yet, you can <a href='register.php'>register here</a>";
                }
            }
        }
    }
?>

The only error I am getting is from the login code when you come back with an error is when there is no errors at all.

patk570 42 Newbie Poster

I think I figured out what is going on...In the code for HTML I have a dropdown that they select the computer from and modifies the code after its already been generated. Since the code is not present during the initial loading period, it therefore does not exist. I am now unsure of how to get the code to read the modified html code that gets generated afterwards.

patk570 42 Newbie Poster

Hello everyone, I am trying to update a database as well as insert information into the database and this is what I created to do so. Only, I am getting the email and its not updateding the database...any ideas?

<?php
if ($_POST['submit']) //if the Submit button pressed
  {
                      $con = mysqli_connect("localhost","root","pass","testdb");
                       if (mysqli_connect_errno())
                               {
                                      echo "Failed to connect to MySQL:" . mysqli_connect_error();
                               }

$sql = "INSERT INTO computerdb (name, email, ticket, phone, computerpass, findus, status, notes )
                       VALUES ('".mysqli_real_escape_string($con,$_POST['name'])."','".mysqli_real_escape_string($con,$_POST['email'])."','".mysqli_real_escape_string($con,$_POST['ticketnumber'])."','".mysqli_real_escape_string($con,$_POST['phone'])."','".mysqli_real_escape_string($con,$_POST['password'])."','".mysqli_real_escape_string($con,$_POST['referredby'])."', 'Pending', '".date('m/d/Y H:i:s'). ": Work has started on your computer')";

                       if (!mysqli_query($con,$sql))
                        {
                             die('Error: ' . mysqli_error($con));
                        }
                                $blah = $_GET['computerid'];
                                $cpuname    =    mysqli_real_escape_string($con,$_POST['cpuname']);
                                $sn          =    mysqli_real_escape_string($con,$_POST['sn']); 
                                $model    =    mysqli_real_escape_string($con,$_POST['model']);
                                $brand       =    mysqli_real_escape_string($con,$_POST['brand']);
                                $hdd    =    mysqli_real_escape_string($con,$_POST['hdd']);
                                $memory    =    mysqli_real_escape_string($con,$_POST['memory']);
                                $type    =    mysqli_real_escape_string($con,$_POST['type']);

                             $query = "UPDATE custcomp SET cpuname = '$cpuname', sn = '$sn', model = '$model', brand = '$brand', hdd =  '$hdd', memory = '$memory', type = '$type' WHERE id = '$blah'";

                             if (!mysqli_query($con,$query))
                        {
                                die('Error: ' . mysqli_error($con));
                        }else{

            //if data is inserted successfully, send email
                       $to = $_POST['email'];
                       $url = "http://omitted.com/newportal/do_search.php?query=";
                       $ticket = $_POST['ticketnumber'];

                       $header = 'MIME-Version: 1.0' . "\r\n";
                        $header .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
                        $header .= "From: omitted. <tickets@omitted.com>" . "\r\n";
                       $subject = "Ticket Number ".$_POST['ticketnumber'];
                       $body .= "<html><body>"."\n";
                    $body .= "Hello ".$_POST['name'].",<br>
                        <br>";
                    $body .= "Thank you for stopping by today.<br><br>"."\n";
                    $body .= "The information below is used to check on the status of your computer.<br>"."\n";
                    $body .= "Check Computer Status: <a href=\"".$url.$ticket."\">".$ticket."</a><br><br>"."\n";
                    $body .= "Be sure to like us on <a href=\"http://www.facebook.com/omitted\"><img …
patk570 42 Newbie Poster

all it is doing is saying: 'You have Completed tickets open.', I dont want it to say completed, it needs to day you have x (x = 1 - infinity) tickets open and only for their id excluding completed...

patk570 42 Newbie Poster

I have a database and I have 3 different values that I want to count, to say that You have x amount of tickets open. I am created an array

$array = array(
    'Pending', 'Waiting on parts', 'Waiting for customer response'
);

and a query string

$result = mysql_query("SELECT COUNT(*) FROM computerdb WHERE email = '$id' AND FIND_IN_SET($array,'status' );"); list ( $count ) = mysql_fetch_row ( $result ); echo $count

for some reason it will not count it just errors out...

Error 1:
Warning: in_array() [function.in-array]: Wrong datatype for second argument in
Error 2:
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource

Any ideas?

patk570 42 Newbie Poster

I figured it out, have a look at this:

<?php
if ($_POST['submit']) //if the Submit button pressed
  {
                      include 'conf.php';


                       $sql = "INSERT INTO computerdb (name, email, ticket, phone, computerpass, findus, status, notes )
                       VALUES ('".$_POST['name']."','".$_POST['email']."','".$_POST['ticketnumber']."','".$_POST['phone']."','".$_POST['password']."','".$_POST['referredby']."', 'Pending', '".date('m/d/Y H:i:s'). ": Work has started on your computer')";
                       if (!mysqli_query($con,$sql))
                        {
                             die('Error: ' . mysqli_error($con));
                        }else{

            //if data is inserted successfully, send email
                       $to = $_POST['email'];
                       $url = "http://patrickspcrepair.com/newportal/do_search.php?query=";
                       $ticket = $_POST['ticketnumber'];

                       $header = 'MIME-Version: 1.0' . "\r\n";
                        $header .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
                        $header .= "From: Patrick's Computer Repair Inc. <tickets@patrickspcrepair.com>" . "\r\n";
                       $subject = "Ticket Number ".$_POST['ticketnumber'];
                       $body .= "<html><body>"."\n";
                    $body .= "Hello ".$_POST['name'].",<br>
                        <br>";
                    $body .= "Thank you for stopping by today.<br><br>"."\n";
                    $body .= "The information below is used to check on the status of your computer.<br>"."\n";
                    $body .= "Check Computer Status: <a href=\"".$url.$ticket."\">".$ticket."</a><br><br>"."\n";
                    $body .= "Be sure to like us on <a href=\"http://www.facebook.com/cspcrepair\"><img                                                                                                               src=\"http://www.patrickspcrepair.com/ticketgen/images/facebook.png\" width=\"30\" height=\"30\"></a> and <a href=\"http://www.twitter.com/patricksPCR\"><img src=\"http://www.patrickspcrepair.com/ticketgen/images/twitter.png\" width=\"50\" height=\"30\"></a>!". "\n";
                    $body .= "<br><br><br>Sincerly, <br><br><img style=\"border:none; text-decoration:none;\" src=\"http://www.patrickspcrepair.com/ticketgen/images/signature.png\" alt=\"Patrick Kershner\" />"."\n";
                    $body .= "</html></body>"."\n";
                       $sent = mail($to, $subject, $body, $header);
                       if($sent)
                               header('Location: http://www.patrickspcrepair.com/ticketgen/index.php?success=1&redir=1');
                       else
                               {print "There was an error sending the mail";}

                       mysqli_close($con);
                        }
        }
?>
patk570 42 Newbie Poster

I have a form that i am getting info from and then I want to update certain fields in the database only not all the fields it then sends out an email to the person that filled out the form with a randomly generated ticket number that they can then track the progress on.

Problem 1) Will not update the database with the critera that I want.

Problem 2) Will not send out email in HTML form even with the headers set.

  <?php
if ($_POST['submit']) //if the Submit button pressed
  {

                       include 'conf.php';

                    $name = mysql_real_escape_string($_POST['name']);
                    $email = mysql_real_escape_string($_POST['email']);
                    $ticket = mysql_real_escape_string($_POST['ticketnumber']);
                    $phone = mysql_real_escape_string($_POST['phone']);
                    $findus = mysql_real_escape_string($_POST['referredby']);
                    $pass = mysql_real_escape_string($_POST['password']);

                       $sql="INSERT INTO computerdb (name, email, ticket, phone, computerpass, findus )
                       VALUES ('$name','$email','$ticket','$phone','$pass','$findus')";
                       if (!$sql)
                        {
                             die('Error: ' . mysql_error($con));
                        }else{

            //if data is inserted successfully, send email
                       $to = $_POST['email'];
                       $url = "http://www.patrickspcrepair.com/portal/ticket-status.php?ticket_no=";
                       $ticket = $_POST['ticketnumber'];

                       $header = 'MIME-Version: 1.0' . "\r\n";
                        $header .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
                        $header .= "From: Patrick's Computer Repair Inc. <tickets@patrickspcrepair.com>" . "\r\n";
                       $subject = "Ticket Number ".$_POST['ticketnumber'];
                       $body .= "<html><body>"."\n";
                    $body .= "Hello ".$_POST['name'].",<br>
                        <br>";
                    $body .= "Thank you for stopping by today.<br><br>"."\n";
                    $body .= "The information below is used to check on the status of your computer.<br>"."\n";
                    $body .= "Check Computer Status: <a href=\"".$url.$ticket."\">".$ticket."</a><br><br>"."\n";
                    $body .= "Be sure to like us on <a href=\"http://www.facebook.com/cspcrepair\"><img                                                                                                               src=\"http://www.patrickspcrepair.com/ticketgen/images/facebook.png\" width=\"30\" height=\"30\"></a> and <a href=\"http://www.twitter.com/patricksPCR\"><img src=\"http://www.patrickspcrepair.com/ticketgen/images/twitter.png\" width=\"50\" height=\"30\"></a>!". "\n";
                    $body .= "<br><br><br>Sincerly, <br><br><img style=\"border:none; text-decoration:none;\" src=\"
       
patk570 42 Newbie Poster

No Deal,

Electro Magnet

patk570 42 Newbie Poster

King Kong

patk570 42 Newbie Poster

no deal, elephant

patk570 42 Newbie Poster

Hello,

My registration script already tests for same username, I am hoping to find something that someone already has made that I can insert that has all the admin variations in it. I know it doesnt doesn't really matter, as to what username they have but there is a blog that I created and dont dint want to have the users confused.

HAHA.

I know there is a huge list of variations of the name Admin/Administrator.

patk570 42 Newbie Poster

Hi guys, I am looking to get a script that has all the variations of the name Admin/Administrator so customers/more advanced users cannot use those types of names. I am either looking to know if a mysql insert into code or a jquery/js code would be the best to use. I do not want any form of the word used.

How would you approach this?
What are your thoughts on this?

patk570 42 Newbie Poster

Take it to a local geek, we know how to clean a computer the right way and without damaging your computer.

patk570 42 Newbie Poster

Have a look at this LINK it should help you

patk570 42 Newbie Poster

You need a NT Password Cracker. What it does is breaks the SAM file that is associated with stored passwords for each user. Look for something like SAMuari or similar.

patk570 42 Newbie Poster

Is the disk still accessible by plugging it into an external source? like a usb hdd hub? or hooking it into another system and access it that way?

patk570 42 Newbie Poster

Why not just hit the back button or navigate to a new page? I don't know anyone that uses a cancel button any more on websites...

patk570 42 Newbie Poster

Teenage Mutant Ninja Turtle(s)

patk570 42 Newbie Poster

This game is just like the Deal or No Deal Game on here with a twist. After an item is posted(i.e. Diamond Ring), you have to start the next item with the last letter of the previous item.

Word was Diamond Rin(g),
Next word is : (G)old Plated Spoo(n)
the next will start with a (n) and so on

Good Luck all!

Here is the starting word:

EdgeStar Portable Air Conditione(r)

patk570 42 Newbie Poster

No deal

100 MBPS Internet Connection

patk570 42 Newbie Poster

Robin Hood, Men in Tights

patk570 42 Newbie Poster

Hey guys, So I went with a MOTO CMS site for my main site and then went with VTiger for my backend system.

patk570 42 Newbie Poster

Hello @pritaes,

I took your suggestion on linking the databases together. I now have a field in libvid that has an array of numbers, like 1,20,28,30 I now need to figure out how to get the data from libvid's array and match it with the categories table in the database.

Would something like this work?

SELECT libvid.categories, categories.id
FROM categories, libvid
WHERE libvid.id = libvid.categories

or is that structure wrong?

patk570 42 Newbie Poster

I fixed the issue i was having, and it is working really good now.

Thanks for the help

//put query string above to get results

$cats_array = explode(",", $myEdit['categories']);

then below that in the checkbox array i have:

<td>
  <label>
     <input name="categories[]" 
        <?
        if (in_array(1, $cats_array)){
        echo 'checked="checked"';
        } else {
        echo '';
        }
        ?> 
    value="1" type="checkbox" />Quadriceps
  </label>
</td>

Now it is working like a charm and I do not have to remember what category each belong to.

patk570 42 Newbie Poster

NO DEAL, REALLY AFRAID OF SNAKES!!!

Vintage Cast Iron Sewing Machine

patk570 42 Newbie Poster

I just got an idea but need to run it by ya's...

<input type="checkbox" <?
$CheckboxChecked = $details['categories'];
if ($CheckboxChecked==1){
    echo 'checked="checked"';
    } else {
    echo '';
    }
?> value="1">Hamstrings

would this work and would I have to do this with everyone?

patk570 42 Newbie Poster

No Deal, I already see things in 3d!

Alienware 18 Gaming Laptop

patk570 42 Newbie Poster

What I am trying to accomplish is:

  1. Get the values from the database so when I go to edit the page I do not have to remember 200 check marks.
  2. Streamline the process for this, if there is a better way of doing this I would love to know.
  3. I am also linking tables in my search string, so it will be something like:

    SELECT libvid.categories, categories.id
    FROM categories, libvid
    WHERE libvid.id = libvid.categories

Any and all input would be great. I thought about using an AJAX script to retreive the values, but got lost, when I was doing research on this topic, I wasn't getting a hits. I know there is a way, but I have no CLUE on how to get all the values to be checked.

patk570 42 Newbie Poster

My edit page is strictly PHP quering from the database using a FETCH command. for the text fields. The categories are in a checkbox array, and using the command categories[] as the name and 1-30 as the value.

patk570 42 Newbie Poster

Ace Ventura

patk570 42 Newbie Poster

Activity When Space Earned
Referred by Stephan G. 1 minute ago 5 GB

Thanks, Stephan G.

My Referral Link

patk570 42 Newbie Poster

Hey everyone, I have an array of checkboxes that hold a value from 1-30, and when I first update the database it stores these values in a comma seperated list like 1,8,9,22 in the MYSQL database.

Now my question is, can I when I go to the edit page to edit the entry into the database, instead of remembering what categories each belong to, have the values automatically check the boxes that it belongs to on my edit page?

I think I just made this more confusing then what it actually is, and if you need clarity, please ask me.

Thanks.

patk570 42 Newbie Poster

gotcha..