Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Escape From MySQHELL - Changing Code From MySQL To MsSql


I've tried to figure it out but I'm no genius. Whilst I can muddle through with PHP & MySQL, when it comes to MsSQL I turn into a jibbering wreck. Code:




View Complete Forum Thread with Replies

Related Forum Messages:
BB Code - Escape A Bracket In BB Code?
Is there a way to escape a "bracket" in BB code? The beginning of a bbcode
post I made starts with something in brackets [like this]. This causes a
strange thing to happen to the remainder of my post. Removing the brackets
makes my post normal. That shows me that I need to escape the brackets.
However, a simple backslash does not seem to do the trick i.e. this [wont
work]

I am not the administrator of the bb forum, just a poster. So I need to know
what to do on my end (as opposed to an adiministrator's power to
reconfigure, etc.

View Replies !
Do I Need To Escape This Code?
After you all gave me some good advice recently, I'm back for more :o)

On my web site, I want to display a 'log out' icon with some text
underneath, ("Log out"), which, when clicked, will end a session.

This is the simple code I'm using for the icon:

<a href="<?php echo $_SERVER['PHP_SELF']; ?>?action=log_out">
<img border="0" src="images/logout.gif" width="74" height="74"><p
style="text-align: center">

This all works fine and, when clicked, the session is ended and the
user returns to my web site's home page.

Now's the complicated, (Well for me, anyway), bit; I only want to show
the 'log out' icon when the user is actually logged in.

So, I've been using isset to determine the session state:

<?php if (isset($_SESSION['user'])) {?>
<a href="<?php echo $_SERVER['PHP_SELF']; ?>?action=log_out">
<img border="0" src="images/greenround.PNG" width="74" height="74"><p
style="text-align: center">
<?php }?>

View Replies !
Code Insertion + Escape Chars
I'm updating my scripts a bit, and I was wondering how I could insert data in a textarea just by clicking a button. For instance add a Url or a smily ... (just like in these forums when posting)

An other question, how do I make sure I don't need to use a to get a ' For instance if I want to add content containing a " ' " I need to write "hello I'm ..."

View Replies !
Php And Mysql Escape Characters
Everytime I want to enter to a textbox area "it's fun" (no quotes) I get an error.

"Problems with Query: 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 's fun'"

I need to enter " it's fun" (no quotes) in order for MySql accept it.

Any work arounds on escape characters? How can I have mySQL just take "it's fun" just like that?

View Replies !
Mysql Real Escape
Upon entry into the database, I first clean form input data with html special characters, strip tags, and mysql real escape string. When I retrieve this data from the db, single quotes aren't coming out right on the pages. Some browsers display a question mark, others a blank space, and another (FireFox) totally screws up the text formatting.

View Replies !
Mysql Escape String Permissions
I am using mysql_real_escape_string() for my $_POST variables but I get this error

Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Access denied for user 'themiss2'@'localhost' (using password: NO) in /home/themiss2/public_html/writing/account_process.php on line 5

I'm not sure how to fix it.

ps. this is all based out of cPanel and phpMyAdmin for web and database organization (if that helps withthe problem)

View Replies !
Mysql Real Escape String() In Conditional Statements
I created the following bit of code that allows me to pass a MySQL conditional statement to a function.

I am trying to figure out where and how would I go about incorporating the mysql_real_escape_string() function?

Is there a way to call the mysql_real_escape_string() in the function itself? Code:

View Replies !
How To Search Strings Escaped By Mysql Real Escape String()?
I am currently developing an article script and there are Titles and Contents. To prevent sql injection, people say we must use mysql_real_escape_string().

So let's say if there is a Title that says "My Friend's best friend", if I look into the MySQL table record, the text will be saved as "My Friend's best friend", where the apostrophe is escaped. Code:

View Replies !
MSSQL Vs MySQL
What is the proper way of using the below query for MSSQL Server?

$result = mysql_query($query) or die(mysql_error());

View Replies !
Mssql To Mysql
I have a table on a mssql database that I am constantly having to manually migrate over to a mysql database. I am wanting to create a script that will sycronize "so to speak" from the mssql database table to the mysql database table.

View Replies !
MYSQL-MSSQL Class?
I have been tryin to find a good MYSQL/MSSQL class from my project.

View Replies !
Diffrence Between Mssql And Mysql
I have a job and have been coding for a mysql server but it turns out my client runs his site on a mssql server. Ive pretty much coded most of the cms, would it be easier to get the client to change servers or to change all my code my code. are the queries much diffrent(im not using any joins or complex queries)?

View Replies !
Possible Migration From MySQl To Access Or MSSQL
I have a site that is running PHP off a mySQL database. However my company is going to be switching to a new web host and one of the candidates is using a Win2000 server. They do have PHP byt the two database options are Access or SQL Server 2000. I have not used PHP with either of these two databases and was wondering if it is possible to do so, and if so are there any difficulties in changing over to them. Any information is appreciated. I really do not want to switch to ASP, and would like to give my company a good argument for not switching to Access or SQL Server.

View Replies !
Converted Database From Mssql To Mysql
We moved our website to a new server and converted our database from mssql to mysql. Now, the resource_dir.php is working, but the next level, resource_cat.php is not working. Code:

View Replies !
Mssql > Mysql Replicate Periodically
Basically, i have a primary database, which is MSSQL. I want to replicate some of this data (results from a query so only certain tables/fields are replicated) every night to a mysql database.

I've had a look at mysql's MyODBC and installed that on my mssql machine, and i've had a play and it seems to work about right.

Just wondering:

a. how can i schedule mssql do do this periodically, i.e 9pm every night

b. is there any thing i should know about before i do this? The mysql database will only be dishing out data so there shouldnt be any chance of corruption.

View Replies !
PEAR MDB2 Works With MySQL, Not With MSSQL
I have an application written originally to work with MySQL which now has to be extended to work with MSSQL also. I have modified all my database calls to use the PEAR MDB2 methods rather than mysqli. Everything still works fine with MySQL, but I have an odd problem when I...

View Replies !
Changing A Row In A Mysql Database
I was just wondering, once you have a row in a certain column set....how do you change it with php for example i have a column named "cookie_hash" in my table...when the user logs in i want to update it every time with an md5 hash of their email and login time..I just dont know how to do so

I have this part $hash= md5($email.date ("l dS of F Y h:i:s A")); But I just dont know how to do the query.

View Replies !
Changing MySql Database
Is there a way to change a Mysql database so the if the "result" column= win and a link is clicked to change it it automatically changes to lose without the user have to type anything/click anything. (Also vice versa).

View Replies !
Changing Iso-8859-2 To UTF-8 In MYSQL
I'm writing to ask you for a help. I need to change all iso-8859-2 signs to UTF-8 in my vBulletin board mysql database.

Examples: ....

View Replies !
Changing Data In MySQL
I have the following php page, it displays my members, by there Status... Approved, Deleted, On Hold etc...

I want to add a 'Delete' next to each member in the table that gets displayed, but only want this 'Delete' button to move the members to the 'Delete' column. Which from a database POV would mean changing the member in the 'MemApp' column from an 'A' to a 'D'. Code:

View Replies !
Changing Localhost IP Address For MySQL
I am moving a bunch of my database sites to a new server. I have to keep the databases hot durring the switch. Is there a way to change the IP address of 'localhost' to another IP address when you connect in PHP to MySQL? That way I wouldn't have to change 'localhost' to the new IP address on every script.

View Replies !
Changing A Mysql Table Name Threw Php?
i have a membership system. one of the feilds in the 'users' table in mysql is called rank. it has 2 posibilities. 1 or 2. 1 means ur a regular member. 2 means your an admin. so in the admin panel, i want to make a part were you can change the rank on a certain user. i was thinking about maybe a html form kinda, where you enter there username, then php searches for it in mysql.

when it finds the desired row, it will display there ranking in a dropdown menu. you can change the ranking in this drop-down, and then click submit. then php would change the ranking in mysql.

View Replies !
Changing Date Format In MySQL
How can I change the way MySQL displasy the date format on my php page? At the moment it displays like YYYY/MM/DD and I want it to display DD/MM/YYYY... Any ideas?

View Replies !
Changing Data In Objectified Mysql Records
I am using this very slightly modified function found here:
http://us2.php.net/mysql_fetch_object
to make mySQL rows into objects of type $classname:

// This takes db result rows and makes real objects of $classname type
function &buildObj($result, $classname) {
while($row = mysql_fetch_assoc($result)) {
if ($row === null) return null;

/* Create the object */
$obj =& new $classname;

/* Explode the array and set the objects's instance data */
foreach($row as $key => $value)
{
$obj->{$key} = $value;
}
$objs[] = $obj;
}
return $objs;
}

This is called by a retrieve: function:

function retrieve($where) {
echo $query = "SELECT * FROM $this->table WHERE " . join(' AND ',
$where);
$result = mysql_query($query);
$rows =& buildObj($result, get_class($this));
mysql_free_result($result);
return $rows;
}

The problem I am encountering is that if I do this in my script:

$listing = new Listing;
$listings = $listing->retrieve(array('row > 1') );
foreach ($listing as $aListing) {
$aListing->address='xxxxxxxxxxxxx'
}
foreach ($listing as $aListing) {
print_r($aListing);
}

The value in $aListing->address is unchanged.

However if I do this:

$listing = new Listing;
$listings = $listing->retrieve(array('row > 1') );
foreach ($listing as $aListing) {
$aListing->address='xxxxxxxxxxxxx'
$newArray[] = $aListing;
}
foreach ($newArray as $aListing) {
print_r($aListing);
}

I see the update values in $aListing->address .

View Replies !
Updating (changing) Mysql Db With Html Table
I wish to use one html-page to view and change entries in a db. Here is the code I got so far, but when clicking "save", it will just display the original data without updating. Code:

View Replies !
Changing Array Format From Result Of MySQL
here is what MySQL returns in a visual way..

game_id | team_id | stat_id
1 | 1 | 1
1 | 2 | 3
1 | 3 | 7
1 | 3 | 6
2 | 1 | 1
2 | 4 | 3

in records with the same game_id, there will be no repeating team_id
in records with the same team_id, there will be no repeating stat_id

so, after I got the query, I made them into this format

PHP Code:

View Replies !
How To Update Mysql Table Without Changing Existing Data
how to update mysql table without changing existing data.

View Replies !
Using MSSQL Server + MySQL On One Server
How do I get MSSQL Server and MySQL working on the same server? I have MySQL running but in PHP.INI when I uncomment the extension=php_mssql.dll line MySQL stops working.

View Replies !
Changing Date Format To Mysql Default Format
i hve a date variable in mm-dd-yyyy format how can i change it to mysql default format i.e., yyyy-mm-dd format ...

View Replies !
Escape
<?php
echo ("Vladimir's brother said, "Ain't that a hoot?"");
?>

Vladimir's brother said, "Ain't that a hoot?"

Vladimir's brother said, "Ain't that a hoot?"

View Replies !
Escape <
I'm adding 3 strings and need to escape possible <? and <<< when they occur. I can't figure out a way to do it. This is the code joining the strings. If it comes across a <? in the results it does not add additional strings in the loop.

$Result = $Result . chr(intval($k/16)+48) . chr(intval(fmod($k, 16))+48);
for($m=0; $m<=$i-1; $m++)
{
$k=ord(substr($mpass,$m,1));
$k=$k+$LASTK+(27*$j);
settype($k, float);
$k= fmod($k, 256);
$LASTK=$k;
$Result = $Result . chr(intval($k/16)+48) . chr(intval(fmod($k, 16))+48)
$j++;
}

View Replies !
Can't Escape Quotes
I'm having a problem trying to display a value which has quote marks. e.g.

View Replies !
Escape Probem
I am having a little trouble copying PHP code into a file, here is an example of what I am trying to do...

View Replies !
Escape A String
If a string contains characters -- and ', how do I escape the string so that I can compare this string to others or store it in database?

View Replies !
Getting Rid Of Escape Characters.
i am sending the contents of an html text area with the name "message" using the mail functions like.

mail($email, $subject, $message, "From: someone@somewhere.com
Reply-To: someone@somewhere.com
X-Mailer: PHP/" . phpversion());

when the user gets the mail all apostrophies (') are escaped like ('). how do i prevent this?

View Replies !
Escape To Unicode?
I've begun dealing with PHP's XML functions (puttup!)

I shoudl say- php's DEFAULT XML functions, no extensions. Probably not
5.0. I don't care...

The POINt is, they choke on funny characters, even encoded funny
characters. You need to use the unicode. (change &ntilde; to ).

Whatevuh.

That's why, why- now ignore that part, because it will distract and
proably cause you to misconstrue the thrust of the question to follow:

Does PHP have a function that will escape all funny characters in a
string (encoded, unencoded, both, either...) to their unicode
equivilants?

In a string- ignore the XML parts of this question.

(I'm looking at pre-proscessing the data coming into forms that will
form the offending XML)

View Replies !
Escape Character & And #
Does anyone know the escape character for & and # like in :
Update GDO_INFO_ER set V_COMMENTAIRE='B&A' where V_USERMODIFICATION='bilal123'
or
Update GDO_INFO_ER set V_COMMENTAIRE='B#A' where V_USERMODIFICATION='bilal123'
I would like to insert & and # literally in the table.

View Replies !
Escape Charecters
Can anyone tell me ho to get certain charecters to be displayed.
When sending email with (') i get () instead. i.e.

This dosen't work becomes dosen

View Replies !
Escape Character
I dont know why the browser doesn't present the php string with some escape character like
, ....
For example: the string "Name
Address" should be printed out like
Name
Address

instead it prints out "Name Address".I tried other ones and do not work. Anyone know why?

View Replies !
Characters To Escape?
I am looking to make my own escaping system, although i don't know the major characters to escape? Is there any really bad characters that must at all times be escaped.

View Replies !
How Can I Escape The XML Syntax
i have a textarea where users can input information about themselves. They can even edit the texts (making the texts bold, italic...). It works fine when i try to add the info into the db. But when i try to display the info from the db, it displays some characters like \" whatever.

I used stripslashes, but it didn't solve the problem. What do you advise me so that i can handle the XML special characters not to disturb my design??

View Replies !
Escape The Xml?> Characters
This seems to cause a problem as PHP takes the?> to be the end of PHP script. I then get a load of PHP in my XML file that was created. Anyway to escape it?

<?php

include("DBConnection.php");

// open a file pointer to an RSS file
$fp = fopen ("rss.xml", "w");

// Now write the header information
fwrite ($fp, "<?xml version=&#391;.0'?><rss version=&#392;.0'><channel>”);

View Replies !
Escape The % Sign
i tryed with addcslashes() and addslashes()

but it still just prints : "%" insted of "/%" .

View Replies !
Escape Slashes
I want to escape backslashes in the below query - DB is MS SQL Server so addslashes() no use. The problem is here... 'O'Co', MS SQL Server won't accept it. PHP Code:

INSERT INTO training(class_ID, ffnumber, firstname, surname, attended, passed, date_reg) VALUES(&#55619;&#57058;', 'ff18728', 'Ann', 'O'Co', 'No', 'No', {fn NOW()}) ESCAPE ''

Any ideas?

View Replies !
Escape Search
I'm trying to grab data from a database where the entry has a single quotation and then re-search based on that. Basically, I grab the entry: michael's car. But, I want to go back into the table and search for everything that has: michael's car. It seems that PHP always escapes the entries once I grab them from the database. Is there a way to avoid this?

View Replies !
Escape @ Sign
The subject may be confusing, but I am sure this is easy. My mind is blank on the solution. I have a script that returns a variable which will always include an email address. I want to process the variable to escape the "@" sign.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Ex.

$email = "bob@bobsite.com";

I want to process the variable above so that it changes the value of $email to...

$email = "bob@bobsite.com";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I am guessing either preg_replace or preg_match is what I am looking for, but I have been unable to figure out how to change the variable by inserting the "" before the "@".

View Replies !
Javascript Escape In Php
I've used the javascript "escape()" function to prepare some data to be saved in a cookie. I'm now trying to read the data in PHP but not having much luck.

View Replies !
Escape Sequence
I have a small script that takes a user's email address and adds it to a text file, but I want it to write each e-mail on a new line I tried this code with no results: Code:

$file = fopen("/var/lists/test","a+");
fwrite($file, $_POST["email"] . ' '
);
fclose($file);

View Replies !
How To Escape String For Preg_match?
I have a string equal to 'www/' that I want to use in a preg_match. Php
keeps giving me the warning:

Warning: preg_match(): Unknown modifier '/'

How can I escape the string so the / in www/ is not interpreted in the
preg_match ?

View Replies !
Why Is PHP Adding Escape Characters?
I'm making a simple preview function. first page is a text area exactly like the one used to post on this page. Page 2 is a preview. Well, on page 2, it's escaping all the escapable characters for no reason at all.

so i type:
hello, "person" what is up?

I get back this:
hello, "person" what is up?

View Replies !
Escape All Posted Variables?
this works well enough when all the elements in $HTTP_POST_VARS are scalars, but it doesn't work so hot if one or more of them is an array:

<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
while(list($key,$val)=each($HTTP_POST_VARS)){$$key=htmlspecialchars($val);}
[/code]

So what I need is an easy way to tell if "$val" is an Array so that I can do something similar to each of its elements in turn.

View Replies !
Php Rawurldecode From Javascripts' Escape()
I'm sending some vars to php from javascript. These vars contain
special chars (like "&" ,",")and also turkish characters. Therefore
I'm using javascripts escape() function to be able to send them
properly. My problem is on the php side. I am using rawurldecode to
convert them back. However, Turkish characters like "I" (capital "I"
with a dot on top) for example still stay encoded as "%u0130".

My page is setup to handle turkish chars and if sent from a database,
display properly. I've googled for an answer and cant find anything.

I've also tried looking at base64 encoding from javascripts' end, to
again decode using base64Decode from php, but nothing seems to work
right.

View Replies !

Copyright 2005-08 www.BigResource.com, All rights reserved