Jump to content

doppis

New Members
  • Posts

    5
  • Joined

  • Last visited

doppis's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. AHHH...that makes a lot more sense now
  2. Anyone and everyone at my company will know what these numbers mean but it looks like I should change that for the identifier issue. Example on how I seen this all working out. Currently, 30(30 is a server by the way...as well as 32 and 31) has around 4000 devices or serial numbers. How am I suppose to associate the 4000 serial numbers to 30 if 30 is a row. That was my thinking of making 30 a column and then I would search through the column for a match of the serial number the user submitted in the html form. Maybe this is all over my head and I need to look into what pyscho stated - database normalization (which im still confused about but I'll be reading up on.)
  3. Thank you for the input...I'll do a little research on database normalization.
  4. I'm having some trouble figuring out what everyone is suggesting. Is there a technical reason why not to use 30, 32, 31 for column names or? In the future, its actually going to be 30, 32, 31global, 31canada, 31fga, 31international, 31mexico (or something along that lines). Should I make a table for each? There will be a total of 6000ish serials that will be scattered on all of the above columns. I feel like its a waste of tables for the small amount of data. I need an exact match...the user will have to copy/paste the exact serial. I'm sorry if my code looks terrible...I am new
  5. Somewhat new with PHP but I think I'm on the right track. I'm trying to search for a serial number on a sql table. I want a response of the serial # and what column its in. There is 4 columns if that helps (id, 30, 32, 31). (serials 002062008002220 002062008002222 002062008002233 are in the table) When I enter in a serial # 002062008002220 (all serials are 16 digits long). I get a blank page to show up... my form <form action="search.php" method="get"> <input id="serials" type="text" name="serials" /> <input type="submit" /> </form> my php <?php $con=mysqli_connect("localhost", "xxx", "xxx", "nsmserials"); if (mysqli_connect_errno ()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $search = mysql_real_escape_string($_REQUEST['serials']); $query = "SELECT 30, 32, 31 FROM nsmtable WHERE 30 LIKE '%$search%' OR 32 LIKE '%$search%' OR 31 LIKE '%$search%'"; $result = mysql_query($query); while ($row = mysql_fetch_array($result)){ echo "<li><span class='name'><b>{$row['serials']}</b></span></li>"; } mysqli_close($con); ?>
×
×
  • 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.