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...
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.
I have a table "tbl" which contains field "column1", and an array $v1 which contains strings "a1,a2,a3,a4", I want to populate all data from "tbl" that column1 matches "a1" or "a2" or "a3" or "a4", how to do that? do I have to split the array first and run this SELECT statement repeatly?
SELECT...
Suppose I have 1000 records in MSSQL DB.
how can I retrieve the records from 300 to 400, in Mysql I can say:
select * from table limit 300, 100
but how to do that in MS SQL server?
Thanks.
I found that the function "htmlentities" doesn't work on my server, for example I have the code:
<?php
$str = "A 'quote' is <b>bold</b>";
echo htmlentities($str, ENT_QUOTES);
?>
it's supposed to display:
A 'quote' is <b>bold</b>
but what I can see is:
A 'quote' is...
I installed PHP5 on the server and works fine.
The problem is if there is error in the php file, the browser just shows the blank page, instead of showing the error message, how can I enable this feature to display error message?
Thanks in advance.
I want to convert the string($date) from "Apr 5 2003 12:00AM" to "04/05/03", what function I should use, I tried:
date('m/d/Y',$date);
$date="Apr 5 2003 12:00AM"
but it returns: 12/31/1969
anyone can help? thanks.
How can I save the image path to DB table from a php form, using relative path instead of absolute path? if I create a file upload box, it lets me select image and upload to the server, but that's not I want, I only need a relative path saved to DB.
Any help will be appreciated.
mike
I want to submit a form, which has multiple dropdown menu: dd1, dd2,dd3.
these values will be passed to the process page to populate the data from DB, on the process page I have code:
$v_dd1=$_request['dd1'];
$v_dd2=$_request['dd2'];
$v_dd3=$_request['dd3'];
if(($v_dd1)<>'') {$clause =...
I have file names like:
a11_001.htm
b34_02.htm
c8_003.htm
Now I want to get the substring before character '_', it will show as:
a11
b34
c8
how can I do that?
thanks for any help.
Hi,
I am in the process of deciding the database and application language.
We have exising MS SQL server running on windows OS, to store data, right now I need to build another seperate system for intranet use, as I am more familiar with PHP+Mysql, I want to use php, now if I use PHP+MS SQL, is...
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.