Alright… I’m like smashing my head into a brick wall over and over again every time I hit refresh and I don’t see 123098
So I created an arbitrary 6 digit number to start with, this is a “repair code” for customers and I figured it’s better to have a large number rather than 1 eg. “Hey, you’re my first customer, good luck.”
Anyway, first, I don’t know when to use quotes. If said
[code=php]$sql = “SQL COUNT Column From Table”
; what would that give me? A string or the value? I would think a string.
I also had a problem of converting an integer to a string, I’m not trying to, but my method of displaying the number which is stored as an Int seems to want to convert to a string.
This is my “code” so far, (garbage)
Login info ommitted
There is currently one row that exists, which has the Rc (repair code) 123097
It is actually auto incremented per entry but my attempts of using LAST was not getting anywhere so I decided to just add 1 to the last value which I’m going to do by taking the base number 123097 and adding the count / number of rows that exist. Seems dumb I know…
[code=php]<?php
error_reporting(E_ALL);
error_reporting(-1);
$servername = “localhost”;
$username = ” “;
$password = ” “;
$dbname = ” “;
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
$count = “SQL COUNT(*) FROM computers”;
$result = $conn->query($count);
$base = 123097;
$number = $count + $base;
$sql = $number;
echo (int) $number;
?>
Any help would be greatly appreciated…
What I’m trying to accomplish isn’t hard, it’s the syntax… the syntax which taxes my parallax of my desire and inability
I want a repair code that people enter into my website and this gives them a status update, the status page spits out their info and a status update / color (eg. yellow = in progress). My websit is very simple… but my mind is also simple.
Thank you for your time in reading this collection of text.