[Solved] Best way to add a space when joining values

This is your solution: $pageTitle = $pageName . ‘ | ‘ . $siteName; Anyway you can use this to: $pageTitle = $pageName . ‘ | ’ . $siteName; In this last, you can give 1,2,3 or more spaces, example: $pageTitle = $pageName . ‘   |   ‘ . $siteName; $pageTitle = $pageName . ‘   |   ’ . $siteName; Reference: http://www.w3schools.com/html/html_entities.asp 1 solved … Read more

[Solved] When should you make an interface/contract, and when not? [closed]

Interfaces are public “contracts” whenever you want to be able to swap the implementation or give someone the flexibility to use another implementation you should use interfaces. Example: You want to store something so you can load it later. You could use something like public function save(MySQL $db, array $data); But this is not very … Read more

[Solved] PHP code always shows wrong result

$result will never be null. You need to check for something like number of rows – $row_cnt = mysqli_num_rows($result); If that is greater than 0, then go to your else. 9 solved PHP code always shows wrong result

[Solved] Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ‘)’ [closed]

You need to escape a character, the backslash, in your array – $list = array( ‘$’, ‘\\’, ‘”‘, ‘_REQUEST’, ‘_GET’, ‘_POST’, ‘_COOKIE’, ‘_FILES’, ‘_SERVER’, ‘_ENV’, ‘GLOBALS’, ‘_SESSION’, ‘toupper’ ); And you only need the backslash once in the array. 3 solved Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ‘)’ [closed]

[Solved] how to only select unique items from the database [duplicate]

You need Distinct $result = mysqli_query($db,”select DISTINCT names from uploadedproduct”); Distinct optimization allows to select only unique rows. The above query selects distinctively but case insensitive. For it be case sensitive, you could use BINARY opeartor: $result = mysqli_query($db,”select DISTINCT (BINARY names) from uploadedproduct”); 1 solved how to only select unique items from the database … Read more

[Solved] how to retrieve MD5 password

I would use password_hash() if you running on php 5.5 or greater When you send the password to the database simply hash it with the function $password = password_hash(filter_input(INPUT_POST, “password”)); The when you pull the password back out of the database do the same thing to the password they submitted. $passwordFromDb = $result[‘password’]; //Password from … Read more

[Solved] Creating a database to query

well, as stated in the comments, your question is very unspecific, but i – as a fan of php and mysql – would say that those are ONE good answer to create a website like that. you can get free software suites to help you with this endeavour, start experimenting on your home computer, learn … Read more

[Solved] How to print power series in php

You can do this: function exponentArr($num){ $arr = array(); for($i=0;$i <= $num;$i++){ $arr[$i] = pow(2, $i); } return $arr; } This will give you an array $arr with the required output. 2 solved How to print power series in php