Jump to content

robrayner

Members
  • Posts

    11
  • Joined

  • Last visited

robrayner's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I must admit that i only know the basics of php, I am self taught and not that up to speed with it. "Do you understand how PHP functions work? " Not really.
  2. How would i implement array_reverse into this $query1 = "SELECT DISTINCT RMA FROM rmatable where RMA like 'RMAD%'"; $result1 = mysql_query($query1); $num_rows=mysql_num_rows($result1); while ($row=mysql_fetch_array($result1)) { $RMA = $row["RMA"]; $row_ID = "$RMA"; natsort($RMA); echo "<option value=\"$row_ID\">$row_ID</option>"; } echo "</select>";
  3. The natsort($rma); worked but now you have to scroll to the bottom to find the latest rma number is there a way you can get it to display like this RMAD1000 RMAD999 RMAD998 and so on Instead of RMAD100 RMAD101 ...... RMAD998 RMAD999 RMAD1000 Thanks Rob
  4. Does the integer column type like having letters and numbers put into it?
  5. Hi All This was working fine until the rma number reached the 1000 mark and now it is putting all the 1000 numbers with the 1's so you have to scroll all the way down the list to find the latest number. Is there away to stop this from doing this? $query1 = "SELECT DISTINCT RMA FROM rmatable where RMA like 'RMAD%' ORDER BY RMA DESC"; $result1 = mysql_query($query1); $num_rows=mysql_num_rows($result1); while ($row=mysql_fetch_array($result1)) { $RMA = $row["RMA"]; $row_ID = "$RMA"; echo "<option value=\"$row_ID\">$row_ID</option>"; } echo "</select>"; ?> Thanks Rob.
  6. Thanks Barand that did the job. Like thara has said can you explain the difference between inner joins and left joins And again thanks for your help.
  7. Thanks Barand This is working to an extent it is pulling data back from the database now, but it is now missing out the units which dont have sims in. This is what it is pull in out of the database. SERIALNO SHIPDATE FRTYPE SIMNUMBER DATANUMBER SMSNUMBER NETWORK COMMENTS RMA 021211 2013-01-03 FR340 8944100030166309**** 07747948*** 07880244*** Vodafone Replacement for CBX00169 NULL 021212 2013-01-03 FR340 8944100030166309**** 07747948*** 07880244*** Vodafone Replacement for CBX00265 NULL 021213 2013-01-03 FR340 8944100030200787**** 07867579*** 07880454*** Vodafone Replacement for CBX00284 NULL 021214 2013-01-03 FR340 8944100030200787**** 07867579*** 07880454*** Vodafone Replacement for CBX00266 NULL 021215 2013-01-03 FR340 8944100030200787**** 07867579*** 07880454*** Vodafone Replacement for CBX00282 NULL but should be pulling back SERIALNO SHIPDATE FRTYPE SIMNUMBER DATANUMBER SMSNUMBER NETWORK COMMENTS RMA 021207 2013-01-03 FR340 Replacement for CBX00115 NULL 021208 2013-01-03 FR340 Replacement for CBX00358 NULL 021209 2013-01-03 FR340 Replacement for CBX00168 NULL 021210 2013-01-03 FR340 Replacement for CBX00299 NULL 021211 2013-01-03 FR340 8944100030166309**** 07747948*** 07880244*** Vodafone Replacement for CBX00169 NULL 021212 2013-01-03 FR340 8944100030166309**** 07747948*** 07880244*** Vodafone Replacement for CBX00265 NULL 021213 2013-01-03 FR340 8944100030200787**** 07867579*** 07880454*** Vodafone Replacement for CBX00284 NULL 021214 2013-01-03 FR340 8944100030200787**** 07867579*** 07880454*** Vodafone Replacement for CBX00266 NULL 021215 2013-01-03 FR340 8944100030200787**** 07867579*** 07880454*** Vodafone Replacement for CBX00282 NULL thanks Rob.
  8. The only thing common between both tables is the SERIALNO SERIALNO SHIPDATE FRTYPE COMMENTS RMA ADVIVENOTE COMPANY_id are in the products table and SIMNUMBER SMSNUMBER DATANUMBER NETWORK SERIALNO are in the sims table
  9. Thanks for your reply I have tried what you have suggested but I am getting no results returned and when I use phpmyadmin and run the query I am getting Column 'COMPANY_id' in where clause is ambiguous .
  10. Hi All I have got a little issue with a bit of php code. I am trying to fill in a table with content pulled from a mysql database. The data is getting returned OK but if a field is blank then the result from the previous result is getting fill into the table making it look like there is duplicates. See below my code $sql = "SELECT `SERIALNO`,`FRTYPE`, `RMA`, `COMMENTS`, `ADVICENOTE` FROM `products` WHERE `ADVICENOTE` = '$ADVICENOTE' AND `SHIPDATE` = '$SHIPDATE' AND `COMPANY_id` = '$COMPANY_id' ORDER BY `SERIALNO` ASC LIMIT 0 , 3000"; $query = mysql_query($sql); $i = '1'; while ($row = mysql_fetch_array($query)) { $SERIALNO = $row["SERIALNO"]; $FRTYPE = $row["FRTYPE"]; $RMA = $row["RMA"]; $COMMENTS = $row["COMMENTS"]; $q = $i++; $sql1 = "SELECT * FROM `sims` WHERE `SERIALNO` = '$SERIALNO'"; $query1 = mysql_query($sql1); while ($row1 = mysql_fetch_array($query1)) { $SIMNUMBER = $row1["SIMNUMBER"]; $DATANUMBER = $row1["DATANUMBER"]; $NETWORK = $row1["NETWORK"]; $SMSNUMBER = $row1["SMSNUMBER"]; } echo "<table width =\"100%\"><tr> <td align=\"center\" Class=\"TableRowTitle\" width=\"5%\">Serial No</td> <td align=\"center\" Class=\"TableRowTitle\" width=\"10%\">Ship Date</td> <td align=\"center\" Class=\"TableRowTitle\" width=\"5%\">FR Type</td> <td align=\"center\" Class=\"TableRowTitle\" width=\"25%\">Sim Number</td> <td align=\"center\" Class=\"TableRowTitle\" width=\"10%\">Data Number</td> <td align=\"center\" Class=\"TableRowTitle\" width=\"10%\">Voice Number</td> <td align=\"center\" Class=\"TableRowTitle\" width=\"20%\">Network</td> <td align=\"center\" Class=\"TableRowTitle\" width=\"15%\">Comments</td> <td align=\"center\" Class=\"TableRowTitle\" width=\"5%\">RMA</td></tr>"; echo "<tr><td><a href=\"checkserialnew.php?row_ID=$SERIALNO\">$SERIALNO</a></td> <td nowrap>$SHIPDATE</td> <td nowrap>$FRTYPE</td> <td>"; if ( $SIMNUMBER == "") {echo "NO SIM"; } else { echo "$SIMNUMBER"; } echo "</td><td>"; if ( $DATANUMBER == "") {echo "NO DATA NUMBER"; } else { echo "$DATANUMBER"; } echo "</td><td>"; if ( $SMSNUMBER == "") {echo "NO VOICE NUMBER"; } else { echo "$SMSNUMBER"; } echo "</td><td>$NETWORK</td><td>$COMMENTS</td><td>"; echo "<a href=\"returnwarranty.php?row_ID=$RMA\">$RMA</a><td></tr>" ; } echo "</table>"; echo "Shipped to <b>$COMPANY_id</b> on Advice Note Number <b>$ADVICENOTE</b> QTY <b>$q</b><br>"; Thanks Rob.
×
×
  • 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.