so, my quest for the perfect gallery continues. my question to you all is this: what gallery applications do you use and what do you think of them? I prefer php and no need for mysql, but I'm open to other options. the only thing I'm adamant about is not using javascript. ;)
OK, I am not an AD specialist, far from it. However, it is falling to me to do some user creation and maintenance as I have the ability to script from the SQL database and perform mass operations.
I have been looking for an answer to this for a bit and cannot find any info that explains the behavior that I am seeing.
When I add accounts with a DSADD command, the displaynam shows as the logon name and not the value I specify in the -display attribute. The Display Name field is populated and shows up corectly, both in the GUI and with DSGET USER [name] -display.
I can right click in the MMC and rename the user, but that defeats the automation a bit.
I have a base class in which I'd like to extend. The thing is, the base class connects to a database. How can I make it so any classes I extend from base class will share the one connection to the database and not make a duplicate connection for each object i make?
example:
class base {
var $connection;
function base(){
$this->connection = mysql_connection("server","user","password");
mysql_select_db("database",$this->connection);
}
function exec($query){
return mysql_query($query,$this->connection);
}
}
class child extends base {
var $foo;
var $bar;
function child(){
$this->foo = mysql_result($this->exec("select foo from foobar"),0);
}
}
I'd like it so no matter how many objects i make of the child class, they all share the same database connection. I think in PHP5 you can do something like "shared $connection" but i'm using php4.
Hi all. This will be my first post to the community, so before anything I'd just like to say how educational its been reading your posts all this time. Now then, here's my contribution.
I've recently been playing with what I think is an interesting technique for adding relevancy and context to my pages. Basically, I embed a small, invisible message within the HTML of a page or within the link to that page which is only visible to people who follow special links. This enables me to embed certain so-called "relevancy messages" on the destination page of a link that helps keep visitors oriented when browsing through my site. (This is exceptionally beneficial when back-linking to old blog posts!)
A much more detailed explanation of what I'm talking about is on my site. A brief explanation of what I first did is this:
When I write links that reference my old pages, I go back to those old pages and insert a named anchor (or tag the element with an id to reference in my link with a fragment identifier).
I add a title to that element so I can hide it within the HTML for visitors who browse normally, but show it to visitors who follow links to that fragment.
I've added a style rule in my pages to display that title text before the fragment only for visitors who follow the special links, specifically, *:target::before { content: attr(title); }
This means when visitors click on a link to a fragment within a page, they see a clear, short message explaining its relevance. Especially on long pages where my link only references a small part of it, this is an enormous enhancement to usability because it ensures a smooth transition of context between one page and the next. Coupled with helpful title text on the source link itself, it can help create an extremely smooth yet still unobtrusive browsing experience.
As an extension and major enhancement, I've also been experimenting with "dynamic relevancy messages" as a sort of mini-API to allow anyone to include their own relevancy message into my pages when they link to me. The crux of this technique uses a variable within a GET query-string to plug into the above CSS content-before rule.
So what do you think about this technique? Useless? Great? Superfluous? All feedback welcome.
I'd be especially interested to hear from web accessibility gurus who can test the accessibility of this technique and PHP gurus who can help break my site by using XSS attacks for the dynamically generated CSS rule. As I'm somewhat of a novice in that area (that is XSS in the context of CSS, since it's usually an HTML/SQL thing), I'd appreciate it if you can help me fortify my defenses against what is potentially a very obvious attack vector on my site now.
Thanks for your time. :)
(Oh yeah, and, um, you gotta use Firefox or another CSS2-compliant browser such as Safari, or a recent version of Netscape, or Mozilla in order for the CSS to work, obviously. It won't work with any version of Internet Explorer or Opera. Sorry.)
I'm actually interested in hearing your definitions or seeing good examples of SQL. I'm a bit uncertain of what it is. The best I could do is, "SQL is a database creation and modification program."
Hi everyone, I just joined, I think I have a simple question but my brain has frozen and is having difficulty remembering my SQL lessons from university a few years back...
I have 2 tables - Student and Unit, Student lists all name and contact details, Unit lists all subjects each student is studying. Each ONE student has MANY units and each ONE unit has MANY students. How can I perform a query that lists ALL units being studied by EACH student?
as in:
Student 12345 Units ABC123, DEF321, HIJ567
Student 45678 Units TUV654, DEF321, MNO321
I've been trying variations of GROUP BY and HAVING, to no avail...
This is long so a cut tag... So recently I’ve been working on some new stuff. In recent versions of Mozilla (including Firefox) there is now a SOAP client. This means that a web application can access the server at any time, and not just when the page loads. This means a huge amount of flexibility is now available to the developer in a DHTML application. I have been playing with this for several months and realized that a large amount of the code is very repetitive.
I am working on a application to build these applications. I have a DHTML page which lets you model your application. It pulls table and index definitions from a MySQL database, and then it lets you set up validation rules for each field, set up custom SQL queries (In addition to a number of automatically generated ones), set field labels, and change other things about the data model.
So far I can auto generate * DHTML Forms * Javascript glue for the forms * Javascript to wrap the soap functions into simple javascript methods. * PHP classes to access a mysql database * A wrapper to serve the PHP classes up as SOAP.
Still to do
* Data validation * Unit test frameworks * Installer scripts for a generated application
For more information see my wiki I plan to have the code on source forge (project “xulbuilder”) today or tomorrow
I'm working on a database table and am having trouble getting the dates added properly. I want two date fields, one to store the date the record was created, the other to store the date it was last modified. However, I can't figure out how to get the fields to hold anything but a bunch of zeros. I've tried TIMESTAMP and DATETIME and using the PHP time function and reading through the mysql.com documentation and am still in the dark. Any help would be appreciated.
Does anybody read about creating MySql connection's pool in PHP like in Java2EE. I have read a LOT about mysql_connect and mysql_pconnect but no one word about pools.
I have a timestamp in my MySQL database. I grab the information along with the other table information using a select, then want to display it in my PHP pages. However, everything I've tried turns up really funny displays. Is there a way in PHP to format MySQL timestamps?
I am working on a website on my PC, and I don't know anything about servers but I wanted to develop locally, so I am using a WAMP package. I would like the site to be able to display database entries from mysql that are in Japanese, but when I call them I just see question marks instead of the Japanese (using various browsers and encoding options). I can, however, just echo Japanese text in the php file and it will display properly. Also, in phpmyadmin where I am creating the database the Japanese is displaying correctly.
I don't know if it's a problem with the server, mysql, or the script, so I don't even know where to start. I have tried it with the db, table and fields collated in both sjis_japanese_ci and utf8_unicode_ci, with the same results.
Does anyone know what the problem could be? Thanks!
I'm trying to connect to a PostgreSQL database on a system that only allows unix socket connections. The DNS I'm trying is below, but no joy so far. I've verified that I can connect to the database on the commandline with 'psql'.
Alright, so I'm a bit new to MySQL. I haven't had to work with databases much, and when I have done them, it was with Access (Ick!). Anyway, i've got a php page that I'm trying to connect to a MySQL database. This isn't how the data's going to be displayed, obviously, but I'm unsure where to go from here.
$query += "ORDER BY residental_types.index, residental_links.name;"; $result = mysql_query($query) or die('Query failed: ' . mysql_error()); // Free resultset mysql_free_result($result);
// Closing connection mysql_close($connect); ?>
I've got my query seperated from the code, but as I know very little about MySQL, I don't know if the syntax is correct or not.
SELECT * FROM residental_links, residental_types WHERE ((residental_links.section)=(residental_types.type)) ORDER BY residental_types.index, residental_links.name;
Whenever I try and access the database and the tables, I can connect, but I can't display any data.
Connected successfully
Query failed: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '0' at line 1
I'm working on a form that will input information into a MySQL. I want to make sure that I don't get any malicious code allowed in the forms. Does anyone have good resources on sterilizing form information?
i finally installed php5 as a cgi on my server because the server company has not upgraded to php5 yet. PHP5 runs only in 1 specific directory.(.htaccess file) Php appears to work fine as php5 but now i can't get it to read the mysql db.
the mysql library is compiled and i don't get an error when the connection string is called. the results from the query just doesn't appear. I'm definite it's not the php code because I haven't altered the code.
Anyone have any idea as to why? -Thank you all in advance!
here is the php code: maybe something changed w/ php5? $sql="SELECT categoryid, category FROM t_category ORDER BY category ASC"; $result=$this->f_selectquery($sql); foreach ($result as $key => $value) { echo " \n"; }
here is the configure command. './configure' '--prefix=/home/acctname/php' '--enable-force-cgi-redirect' '--with-xml' '--with-libxml-dir=/home/acctname/php/lib' '--enable-soap' '--with-xsl=/home/acctname/php/lib' '--with-mysql=/home/acctname/php/lib' '--with-curl=/home/acctname/php/lib' '--with-mhash-dir=/home/acctname/php/lib' '--with-mcrypt-dir=/home/acctname/php/lib' '--with-zlib-dir=/home/acctname/php/lib' '--with-jpeg-dir=/usr/' '--with-png-dir=/usr/' '--with-gd' '--enable-gd-native-ttf' '--enable-ftp' '--enable-sockets' '--enable-wddx' '--with-iconv' '--enable-soap'
here are the mysql properties under php MySQL Support enabled Active Persistent Links 0 Active Links 0 Client API version 4.1.8 MYSQL_MODULE_TYPE external MYSQL_SOCKET /var/run/mysqld/mysqld.sock MYSQL_INCLUDE -I/usr/include/mysql MYSQL_LIBS -L/usr/lib -lmysqlclient
Directive Local Value Master Value mysql.allow_persistent On On mysql.connect_timeout 60 60 mysql.default_host no value no value mysql.default_password no value no value mysql.default_port no value no value mysql.default_socket no value no value mysql.default_user no value no value mysql.max_links Unlimited Unlimited mysql.max_persistent Unlimited Unlimited mysql.trace_mode Off Off
Anyone know of any good pagaination functions - I've tried to code my own and I seem to be going around in cicles. What I've writen is:-
function disp_page($offset, $max_rows, $table, $base_url)
{
mysql_select_db(DB);
if(!isset($offset))
{
$offset=0;
}
$offset=($offset+$max_rows);
// Define the SQL calls
$sql="select * from $table limit $offset, $max_rows";
$sql_tmp="select * from $table";
// Make the SQL calls
$result=mysql_db_query(DB, $sql);
$tmp=mysql_db_query(DB, $sql_tmp);
$total_rows=@mysql_num_rows($tmp);
// Define other variables
$total_pages=(ceil($total_rows/$max_rows));
paginate($offset, $total_rows, $base_url, $max_rows, $total_pages);
// Display the results
while($row=@mysql_fetch_row($result))
{
disp_row($row);
}
echo"$ltbr>";
paginate($offset, $total_rows, $base_url, $max_rows, $total_pages);
}
function paginate($offset, $total_rows, $base_url, $max_rows, $total_pages)
{
// PREV link
if($offset > 0)
{
disp_prev($limit, $base_url, $max_rows);
}
// Page Numbers
if($total_pages > 1)
{
// disp_page_nums($offset, $base_url, $total_pages, $max_rows);
}
// Next link
if(($offset + $max_rows) < $total_rows)
{
disp_next($offset, $base_url, $total_rows, $max_rows);
}
// Empty Results set
if($total_rows==0)
{
echo"$ltbr>$ltcenter>No Records to Display$lt/center>
";
}
}
function disp_row($row)
{
// This function is to be edited to display the data how needed
echo"$lta href=\"?disp_t=topic&topic_id={$row[0]}\">".$row[2]."$lt/a>$ltbr>";
}
function disp_prev($offset, $base_url, $max_rows)
{
$tmp_offset=($offset-$max_rows);
if($tmp_offset $lt 0)
{
$tmp_offset = 0;
}
$offset=$tmp_offset;
$url=$base_url."&offset=".$offset;
echo"$lta href=".$url.">PREV$lt/a> ";
}
function disp_next($offset, $base_url, $total_rows, $max_rows)
{
$tmp_offset=($offset + $max_rows);
// echo"$ltp>tmp_offset=$tmp_offset offset=$offset