Jump to content

kaozdragon

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

kaozdragon's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. what do you mean a graphic login? you mean when you press the login button it goes to a screen with just a graphic on it?
  2. i've looked online and so far i've only gotten scripts of the search engines where they do full-text searches or the ones that retrieve one variable in the database and retrieve it. i've been able to squeeze in 2 variables but when i do more, it starts to mess up. just wondering if there was a better way of doing this, rather than setting all empty variables to an abiguous number that will match all comps. so to recap, i have 2 questions. 1. how do you filter out more than 1 variable in a mysql database search? 2. is there a better way to do this than what i'm doing? <?php include("connect.php"); include("head.php"); //get variables $brand = ("[^a-z0-9A-Z]", "",$_POST["brand"]); $hddcap = ("[^a-z0-9A-Z]", "",$_POST["hddcap"]); //if hddcap does not exist, makes it 0 if (!$hddcap) {$hddcap = 0;} echo "<center>Results</center><BR>"; //print results $result = mysql_query("SELECT * FROM computers WHERE brand LIKE '%$brand%' && hddcap>'%$hddcap%' ORDER BY series, model"); while ($row = mysql_fetch_array($result)) { echo "<a href='computer.php?id=" . $row['id'] . "'>" . $row['brand'] . "'s " . $row ['series'] . " " . $row['model'] . "</a><br>"; } include("foot.php"); ?>
  3. sorry, simple answer....just had to use || and && operators.
  4. i'm really new at php and i was trying to look online for simple php search engine scripts and they all seemed too complicated...especially for my needs. and the one on about.com or smth didn't even work. so i tried making my own. the problem is i don't know how to get my mysql_queries to look at multiple variables to limit the search. Here's what i have so far. <?php include("connectionx.php"); include("header.php"); $fname = $_POST["fname"]; echo "<center>Results</center><BR>"; $result = mysql_query("SELECT * FROM users WHERE firstname LIKE '%$fname%' ORDER BY lname, fname"); while ($row = mysql_fetch_array($result)) { echo "<a href='info.php?id=" . $row['id'] . "'>" . $row['lname'] . ", " . $row ['fname'] . "</a><br>"; } include("footer.php"); ?> what i want is the person to be able to search for a similar first name and say...an age between 15-25. thanks.
  5. thanks a lot. i got it working and the replies were almost immediate.
  6. not quite too sure how to explain this but..i'll try the best i can with what i'm doing. i'm making a database (obviously) where i want the user to be able to register whether they want notifications with a checkbox. so how i did that is i made a checkbox that if it's checked it will return the value "Yes" to the db. now i want the user to be able to change that when they want. how do i make another page to retreive the checkbox already checked and if they want to update it, they can uncheck it and update it. thanks in advance and i hope this is clear enough.
  7. it's alrite, thanks for trying to help tho. i just went to the live chat and someone told me to just put in a date in the table stupid me. i guess i just gotta use a GET function and put that into everything. hope that works.
  8. Just wondering how complicated something like this would take to script as my PHP skills are limited. Here's my problem in a nutshell, I'm trying to create an online signup list for jobs in a "restaurant" type thing. I've got the part where I can get users to login, signup for certain jobs and when the list is full, they can't sign up anymore. The problem I'm now having is, I now have to create the MySQL table and the php signup page for every day of the year. Is there an easier way to create this? What I was thinking was if it was possible to make one signup list and have a constant variable that changes ... actually I have no clue how to get around this. Could anyone point me in the right direction? or should I just create all the pages manually, it's possible and I'd have to do it because the project is kinda due soon Thanks in advance.
  9. thanks =.= i just started with php a couple days ago....trying to finish this IT project.
  10. $result = mysql_query("SELECT * FROM signup"); $row = mysql_fetch_array($result); $increase = mysql_query("UPDATE signup SET hot = hot+1 "); $username = $_COOKIE['username']; $adduser = mysql_query("UPDATE signup SET hotname ='$username'"); $adduser2 = mysql_query("UPDATE signup SET hotname2 ='testing2'"); if ($row['hot']==0) { $increase; $adduser; echo "User has been increased to " . $row['hot'] . " and the user, " . $row['hotname'] . " has been added. <a href='signup.php'>Signup again</a>"; mysql_close($con); } elseif ($row['hot']==1) { $increase; $adduser2; echo "User is now at " . $row['hot'] . " and the user " .$row['hotname2'] . "has been added. <a href='signup.php'>Go back</a>"; mysql_close($con); } else { echo "full up, sorry."; } for some reason, even when $row['hot'] is set to 0 in the table, it will add both adduser and adduser2. any help would be appreciated, 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.