Order ID

Codes here !

Moderators: egami, macek, gesf

Post Reply
tee2017
New php-forum User
New php-forum User
Posts: 3
Joined: Tue Aug 15, 2017 9:59 am

Tue Aug 15, 2017 10:18 am

dear good everning every people, i tee 34 years and i am a not professional php developer i true to school and understand
also because i not professional i not update new dev for php style mysqli etc because i dont understand and i afraid need to change many code to me old codding

actually working for orderid number

the code

Code: Select all

$qu1b="SELECT orderid FROM users WHERE  orderid=(SELECT MAX(orderid) FROM users)"; 
$rsqu1b = mysql_query($qu1b);
$rowqu1b = mysql_fetch_row($rsqu1b);
$order_id1b = $rowqu1b[0] + 1;   
problem is code not inscrease over 10 , also i try to database add a number 107 for check if him increase to 108 problem him not get +1 from the MAX ... strange

i just want to know how can change number predeced by a code
for sample the orderid is just a number actually 9 next order the orderid is 10 how i can set for sample date today +1 = orderid 0815201710
or add a code style next order a not 10 are similar ORXXXEMA10

User avatar
hyper
php-forum Fan User
php-forum Fan User
Posts: 728
Joined: Mon Feb 22, 2016 5:52 pm

Tue Aug 15, 2017 2:56 pm

You really should learn to use PDO, if the school upgrade your PHP version, you will have a lot of problems.

And you should have a go at adding a number to the end of a string? There's no problem helping when you don't understand something , but you haven't even tried - it really is a basic.

tee2017
New php-forum User
New php-forum User
Posts: 3
Joined: Tue Aug 15, 2017 9:59 am

Tue Aug 15, 2017 10:45 pm

dear

I stop you, i writing to me first post i not developer just amator , so i dont come here for get judgment i not tried , how you can permit to judge ?
I respect every peoples i not judge any people do same , because i dont come here for listen post same you reply me.
i not come for developer build me code , only ask me where i wrong without add personal bad judgment.
or better you do not post. because what your bad mind i dont care!
You refrain from making unfounded judgments.

i up your understand
Kind regards
tee

User avatar
hyper
php-forum Fan User
php-forum Fan User
Posts: 728
Joined: Mon Feb 22, 2016 5:52 pm

Wed Aug 16, 2017 9:31 am

I understood that English is not your first language, and offered some advice to learn PDO - it is up to you if you take that advice or not. The biggest problem if you do not learn it is that when your school upgrades to PHP 7, you will not be able to use what you are trying to learn, also what you are trying to learn is very insecure, so either way you will have problems, it is a waste of your time and my time to fix the script that you have provided.

To the second part of my post, if you do not try to script something for yourself, you will find it very difficult to learn - if coding is not for you then that's fine, but what you have asked is very basic variable manipulation, if I give you the script for it you will not have learned anything.

If you do not want to learn php or coding that is also fine, but don't expect someone to solve all of your coding problems since this forum is to help people learn php not to do their homework.

Judge me further if you wish, I have offered you reasoned answers, it's up to you how you interpret it.

tee2017
New php-forum User
New php-forum User
Posts: 3
Joined: Tue Aug 15, 2017 9:59 am

Wed Aug 16, 2017 1:34 pm

i inform you after verification the code is correct the problem provide for the database wrong assignment on the orderid only because i forget set to default 0
so i can judge you also and ask you did not even bother to check if my code was right or not before post your reply !! ** you see easy to judge people ! **

you ask for security , show me 1 website in the world cannot hack ! and i believe you

I like people optimist, you answer to posts for what if you feel that people who pass here do not even give the trouble to try ??

is not because peoples dont try come here , is because him dont see issue to resolve 1 problem. also when you can set 1 development 1 hour , my i have to try 3 days for get the same result. and your know i not developer and you want i school now php7 you mind is good idea? for me better i school again with php 5.6 and when i enought for understand i can update to php7 or others. you dont drive truck before drive a car.

same Oz said : ""each thing have a time ...And have a time for each thing.""


tee

User avatar
hyper
php-forum Fan User
php-forum Fan User
Posts: 728
Joined: Mon Feb 22, 2016 5:52 pm

Thu Aug 17, 2017 8:02 am

PHP 5.6 is not easier to learn than PHP 7.

MySql functions are not easier to learn than PDO.

Post Reply