Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function sendSpId()
- {
- global $id;
- global $connection;
- $sql = "CALL `sp_st_SelectUserAll`($id)";
- $result = mysqli_query($connection, $sql);
- if ($result === FALSE) {
- die(mysqli_error($connection)); // TODO: better error handling
- }
- //loop the result set
- return mysqli_fetch_array($result);
- }
- <?php
- $serverName = "localhost";
- $userName = "root";
- $pass = "";
- $dbName = "univercity";
- $connection = mysqli_connect($serverName, $userName, $pass, $dbName);
- mysqli_set_charset($connection, "utf8");
- if ( !$connection ) {
- die( 'connect error: '.mysqli_connect_error() );
- }
- ?>
- BEGIN
- SELECT * FROM `students` WHERE `id`= id;
- END
- $id = $_SESSION['id'];
- Commands out of sync; you can't run this command now
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement