Store database value in variable using php

Botoho

For example. I have a select statement that is "select ID from students where student name ='name';"

Now I don't wanna echo the student ID but I wanna store it in various where I can reuse it. How do I do it.

287 Views
About the Author
"select ID from students where student name ='name';"
Mr.M 62 Future Programmers

Then you will need to first declare a global variable then within your select statement assign this variable with the selected student name.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.