I have file uploaded to the server by using move_uploaded_file(), the uploaded files have the different file type(extension name like jpg, gif, pdf...)
Now I want to retrieve these files and have it linked from the webpage, I already have the file name, the problem is how the script knows the...
In php file I have a value for example $a=40, and an array $a[]=[10,20,30,40]
is there a function to find if this variable is one of the element of the array? thanks.
I tried to populate data from DB to textarea on the page(file1.php), however as it's impossible to make hyperlink and change color in textarea, so I want to retrieve data to another php file(file2.php) and include it into file1.php, the problem is how to set and restrict the width and height, to...
In the table, there is a column (col varchar 20).
I have these values saved:
1_1
1_2
1_9
1_14
now I want to get the max value "1_14", if the column is INT type, I can easily use MAX(col), but it's the varchar type, if I use MAX(col), I will get "1_9", so how to get the max value in the varchar...
If I want to display the included file's information based on passed value, is it possible to do that?
for example:
file1.php:
<?
$a=$_GET['p'];
if ($a==1) {
print "ABCD";
}
elseif ($a==2) {
print "XYZ";
}
?>
file2.php:
<?
...
include "file1.php?p=1";
...
include "file1.php?p=2";
...
?>
so...
Finally I found the solution.
If I use "select message from tb1", then mssql_query() only take first 255 characters, so I have change "varchar 5000" to "text" type, or do this:
SELECT CONVERT(TEXT message) AS message FROM tb1
then it works fine.
I went to Query Analyzer and changed "Maximum Characters Per Column" to 8192, when I run SELECT statement from "Query Analyzer", it shows correct text(more than 255 characters), but still doesn't display correctly on the browser.
I don't think it's caused by Query Analyzer setting...
So what is the solution to display text that has 255 or more characters?
As the data is alreay stored in the table, only issue is how to display that column.
I use Microsoft SQL server Enterprise Manager to build the table.
1) Yes, I have set the column "message varchar 5000".
2) If I directly go to "SQL server Enterprise Manager-->Console Root-->SQL server group-->tables", and open table, I can see the column "message" has more contents(though I'm...
I have text contents that is saved in the table column "message varchar 5000"
However when I tried to retrieve it, it only display the first 255 characters:
$query="select message from tb1 where id=1";
$result=mssql_query($query);
for ($i=0;$i < mssql_num_rows($result); ++$i)
{...
I have two tables: tb1, tb2
"tb1" contains fields:
user,
project,
lastupdate
"tb2" contains fields:
user,
profile,
address
"tb1": each user may have multiple projects, with different update time.
Now I want to join this two tables to list all users with profile, address and the latest...
In the form textarea, I entered:
"test"
'test'
\test\
/test/
the script uses funtion "htmlentities(string,ENT_QUOTES)" to convert single/double quote and save it to Microsoft SQL server with the format:
\"test\"
\'test\'
\\test\\
/test/
When I tried to retrieve it back with...
I want to create two multiple select box, with four buttons(Add, Add All, Remove, Remove All) between them, user can select one or more item from one side, then click the button so it will be shown on the other side, how can I do that in php? any suggestion will be appreciated.
Yes, I use Microsoft SQL server, I tried that code, but it doesn't work.
Let me explain more detail, I have two tables ("groups" and "users"), each group has one or more users, table "group" contains group name and array that users inside this group(format in array: user1,user2,user3)
Now I want...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.