php forum
php mysql forum
php mysql smarty
 
Topic Options
#284555 - 03/28/05 11:22 PM PHP code to change a signature
rocket99 Offline
Lurker

Registered: 02/27/05
Posts: 3
I need a php code to do the equivilent of this SQL command:<br /><br />update w3t_Users set U_Signature = "<img src=http://www.myboard.com/ubbthreads/uploads/picture.jpg>" where U_Username = "troublemaker"<br /><br />This works! Now when I try to convert that to PHP, phpmyadmin gives me the php equivilent of <br /><br />$sql = 'update w3t_Users set U_Signature = "<img src=http://www.myboard.com/ubbthreads/uploads/picture.jpg>" where U_Username = "troublemaker"';<br /><br />Which gives me a parse error. I tried replacing $sql with $query, same problem.

Top
#284556 - 03/29/05 12:44 AM Re: PHP code to change a signature [Re: ella]
JoshPet Offline
I type Like navaho

Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
Not sure I follow - that query is correct, you can't do that with just PHP, you need to actually connect to a database send the query to the database. But if you're wanting to do it via ubbthreads, the script would:<br />- Need to include the library by including main.inc.php (so that it connects to your database, and knows all your database settings.<br />- Need to have a call to do_query (to actually perform the query).<br /><br />Example for a 6.5.x forum:<br /><br />
Code:
<br />&lt;?<br />require("./includes/main.inc.php");<br /><br />$query = 'update w3t_Users set U_Signature = "&lt;img src=http://www.myboard.com/ubbthreads/uploads/picture.jpg&gt;" where U_Username = "troublemaker"';<br /><br />$dbh -&gt; do_query($query,__LINE__,__FILE__);<br /><br />?&gt;<br />
_________________________
Joshua Pettit
www.JoshuaPettit.com
My abilities are for hire.

Top
#284557 - 03/29/05 09:20 AM Re: PHP code to change a signature [Re: Daine]
rocket99 Offline
Lurker

Registered: 02/27/05
Posts: 3
Thanks - that worked. <img src="http://www.ubbdev.com/forum/images/graemlins/cool.gif" alt="" /> [beat head on desk] Need to include the library by including main.inc.php - Need to include the library by including main.inc.php - Need to include the library by including main.inc.php [/beat head on desk]

Top



Latest Posts
[7.2.1] - Naked shoutbox
by bellaonline
05/05/12 05:00 PM
[7.x] Stop Forum Spam Integration v0.4
by bellaonline
05/05/12 03:53 PM
Shout Box

(Views)Popular Topics
Known public proxy servers 1689885
Integrated Index Page (IIP) 5.3.1 555705
Finished-[6.5.2] Games Arcade Deluxe v1.9 501236
Integrated Index Page (IIP) 5.1.1 415112
TLD Bv2.1 Released - Threads Links Directory 396822
[6.0x] Who's Online 4.0.0 [Finished] 389412
Finished-[6.5.1] Integrated Index Page (IIP) 6.5 330423
Q & A 298663
Slash UBB 266936
[6.3.x] [beta] Hit Hack 2.0 227970
Forum Stats
13621 Members
59 Forums
37191 Topics
295716 Posts

Max Online: 686 @ 06/28/07 07:04 AM

 

 

 
fusionbb message board php hacks