Sinan
-
Posts
8 -
Joined
-
Last visited
Posts posted by Sinan
-
-
You don't need to do that if your array is setup correctly with each product having its' own unique key. May I see your array? Grouping by description is not recommended I would recommend to group by id.
Off-topic:
I think you should take a look at SQL it could make things a lot easier for you.
-
Could you tell what exactly you are trying to do? What's your goal? Because what you are asking is very unusual since you can't stop a loop from "restarting". You can select keys individually however. Like so:
$product_description = $products[0]['product_description'];
But I don't know how your array looks like and I am not clear on what you are trying to do.
-
Why would you use sessions for this? If I were to do this I would just delete my sessions and retry.
I found this on google which might be helpful.
Good luck!
-
array(0) { }
Thats what it returns
I am almost sure it must be in the PHP settings but I dont know what exactly it is.
It works on my laptop where I have set up my own webserver. But on the VPS (where the problem happens) I use appserv. And I used to have it earlier with appserv and he changed it either in the apache or php settings
-
<?php $login = file_get_contents("tpl/contents/login.html"); if(isset($submitlogin)){ //Query setup $loginquery = "SELECT UserID, Password FROM Login WHERE UserID='".mssql_real_escape_string($username)."' AND Password='".$password."'"; $loginresult = mssql_query($loginquery); $countrows = mssql_num_rows($loginresult); if($countrows == 1){ $_SESSION['username'] = $username; $_SESSION['password'] = $password; } if($countrows != 1){ $login .= "<span style='color:red'>Login Failed</span>"; } } echo $_SESSION['username']; //Get template $template = str_replace("%ucp%", $login, $template); ?>
Its included in a file where session_start(); has been used and I tested it with other ways too like
<?php $_SESSION['username'] = "test"; echo $_SESSION['username']; ?>
When I remove $_SESSION['username'] = "test";
It doesnt echo it anymore
-
-
I always kept wondering what the differences between MySQL and MSSQL is and if it is a lot different
Could someone tell me the differences or link me to a place where it is being told?
I am currently learning MySQL but yea I wanna know MSSQL too
Thanks in advance,
Sinan
Help with arrays and for loops, any help would be great!
in PHP Coding Help
Posted
We have too little information to help you out it's like asking to chop a tree without having a tree. We need to see some code.