Hi everyone, For a social system I am working on, I am in desperate need of being pointed in the right direction for how to create a live ajax feed which calls data from a database. Urgently needed, any help much appreciated! Cheers! Jack(Scaasiboi)

Member Avatar
Member Avatar
+0 forum 3

I am having the most horrendous time searching for this. I swear I have trawled the web 10 times over. All I need is to get the URL of the link that has been clicked on, and open it in a new form window that is maximised with a web browser control inside, to the URL of the link. Sounds so simple yet I can't figure it out, I am wondering if any of the marvellous genius' on here can fathom it out, any help appreciated! Jack - Written as I am litterally pulling my hair out.

Member Avatar
Member Avatar
+0 forum 3

Ok here is the required feature: To send data gathered from a database inside a UserControl to the main form which houses the UserControl. Hierarchy at present: Mainform --FlowLayoutPanel ----UserControl The UserControls are generated on the fly by a client list in a database. This all works fine. When you click on the UserControl, the UserControl gathers the information associated with the client and stores them in to strings. What should happen is the strings are then passed and set on screen to the main form, but this doesn't happen. There is no real point in me posting code from …

Member Avatar
Member Avatar
+0 forum 7

Hi everyone, Let me first explain the idea: I have a JSON document which has the following structure: { "timeline": { "headline":"Example Content", "type":"default", "text":"Example Content", "startDate":"2013,1,1", "endDate":"2013,1,28", "date": [ { "startDate":"2013,1,10", "headline":"Example Content", "text":"Example Content", "asset": { "media":"Example Content", "credit":"", "caption":"" } }, { "startDate":"2013,1,14", "headline":"Example Content", "text":"Example Content", "asset": { "media":"Example Content", "credit":"", "caption":"" } }, { "startDate":"2013,1,21", "headline":"Example Content", "text":"Example Content", "asset": { "media":"Example Content", "credit":"", "caption":"" } } ] } } I want to be able to add the following sections using PHP that will get data from a database: { "startDate":"2013,1,14", "headline":"Example Content", "text":"Example Content", …

Member Avatar
Member Avatar
+1 forum 3

I find that if something takes longer than a few hours to do, my patience runs thin, so then my temper starts to flare ;) So, how long does it take others to Begin the classic desk thumping, space slamming, vocal announcing that you are now highly annoyed ;)

Member Avatar
Member Avatar
+0 forum 8

Does anyone see an issue with the following IF statement... I sure can't yet it doesn't work! VARIABLES: $CHECK = A returned value from the database either "y" or "n", the value is returned successfully so I know that is not the issue here. There is no error message returned, the IF statement simply refuses to work. [CODE] $check = mysql_fetch_row($resultX); if($check == "y"){ }elseif($check == "n"){ echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0;URL=main.php\">"; } [/CODE]

Member Avatar
Member Avatar
+0 forum 4

Hi Guys, Another puzzle for someone to try and crack... I have two divs inside the <body> that basically act as two versions of the same page. I need PHP to call one based on a variable retrieved from a database. As it stands, this is what I have... [CODE] <?php session_start(); require("config.php"); if(!isset($_SESSION['username'])) { header('location:denied.php?msg=LOGIN REQUIRED'); } else { } $curruser = $_SESSION['username']; $con = mysql_connect("***","***","***"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("***", $con); $result = mysql_query("SELECT * FROM users WHERE username='" . $_SESSION['username']) . "'"; while($row = mysql_fetch_array($result)) { $version = $row['version']; $username = …

Member Avatar
Member Avatar
+0 forum 4

Hi everyone, Having a little difficulty getting anything from this. The code appears to me to be correct, then again I have been looking at it for hours, so it is possible there could be a mistake...... :/ Anyway, the code seems sound, should let me login and instead gets nothing from the database and says login failed every single time. Any help much appreciated! [CODE] <?php session_start(); require("./config.php"); $con = mysql_connect($sqlserver,$sqluser,$sqlpassword); if (!$con) { die('Connection to SQL Server failed. Error: ' . mysql_error()); } $username = $_POST['username']; $password = $_POST['password']; mysql_select_db($sqldb, $con); $sql= "SELECT * FROM admins WHERE username='$username' …

Member Avatar
Member Avatar
+0 forum 6

I am having trouble returning things from this function. Below is the function. [CODE] function switchframeAQUA(v) { if (v == "0") { document.getElementById("picframe").src = "/frames/cod-liver-oil_pic.html"; document.getElementById("blurbframe").src = "/frames/cod-liver-oil_blurb.html"; } else if (v == "1") { document.getElementById("picframe").src = "/frames/fish-oil_pic.html"; document.getElementById("blurbframe").src = "/frames/fish-oil_blurb.html"; } else if (v == "2") { } else if (v == "3") { } else if (v == "4") { } else if (v == "5") { } else if (v == "6") { } else if (v == "7") { } else if (v == "8") { } else if (v == "9") { } else if …

Member Avatar
Member Avatar
+0 forum 3

Hi everyone, Having difficulty comparing two strings (Inside variables) in php. I have tried several methods, one being strcmp but I think I was doing that incorrectly, and now the simple [B]===[/B] / [B]==[/B] comparison methods. Here is the code: [CODE] <?php if ($pubinfo_username === $currentuser) { echo "<img alt=\"Remove this post\" height=\"20\" src=\"../images/btns/x.png\" width=\"25\">"; } else { } ?> [/CODE] That is the simple [B]===[/B] strict comparison between strings, personally I see no reason as to why this doesn't work, but clearly something is wrong. Any help is much appreciated! Cheers, Jack.

Member Avatar
Member Avatar
+0 forum 4

Hi everyone, Got two mind-puzzling questions for you tha I have been pondering over for the best part of a day now. Q1: Is it possible to have a PHP variable in the name of a function, as in [CODE] Function $variable () { function code here } [/CODE] or something alike. Q2 How do you do it if it is indeed possible ;) All help much appreciated! Jack

Member Avatar
Member Avatar
+0 forum 9

Hi guys, having a bit of trouble with the following piece of code, [CODE] <?php if (strcmp($pubinfo_username, $_SESSION['username'] ) == 0) { echo "<img alt=\"Remove this post\" height=\"20\" src=\"../images/btns/x.png\" width=\"25\">"; } ?> [/CODE] What I need this code to do is compare the string from the variable $pubinfo_username and compare it with the session stored username, It theoretically should work but doesn't, If there is a match then it returns 0 being TRUE and then show the remove button. But this code does not seem to work. Any ideas? Any help much appreciated! Jack

Member Avatar
Member Avatar
+0 forum 2

Ahhhh! OK, so I've been learning PHP for about 7 years now on and off, but never have I taken the time to look into URL rewriting. Until now I've not needed it, but you can guarantee the one thing you think you wont need, you need! I have the following URL style: [url]www.sitename.com/profile.php?user=username[/url] Of which I would like rewriting to: [url]www.sitename.com/username[/url] (Preferred) OR [url]www.sitename.com/user/username[/url] I also need it to be reversible, so if someone types in [url]www.sitename.com/username[/url] it works. Any ideas? Previous attempt was setting up mod_rewrite rules in .htaccess, is this the best way? If not, how? Any …

Member Avatar
Member Avatar
+0 forum 8

I've seen over the last few days many people on the internet and various forums asking for how this is done. Now there is plenty of posts out there that explain how to do this. However I have yet to find one that explains how you work it into a MYSQL string. So here is a how-to for you. Your normal function for [B][I]eregi_replace[/I][/B] is untouched. [CODE]function makeClickableLinks($text) { $text = eregi_replace('(((f|ht){1}tp://)[-a-zA-Z0-9@:%_\+.~#?&//=]+)', '<a href="\\1">\\1</a>', $text); $text = eregi_replace('([[:space:]()[{}])(www.[-a-zA-Z0-9@:%_\+.~#?&//=]+)', '\\1<a href="http://\\2">\\2</a>', $text); $text = eregi_replace('([_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3})', '<a href="mailto:\\1">\\1</a>', $text); return $text; }[/CODE] It is important to check the example above, many tutorials …

Member Avatar
Member Avatar
+0 forum 5

PHPMYSQL - How do you perform a double SELECT query or check against multiple fields? Does anyone know how this can be achieved? What i want is from a search page that has multiple search areas such as name / description / functions and be able to type multiple search queries in to a form and it narrow it down in mysql query. My initial thought was something along these lines: [CODE]$query = mysql_query("SELECT * FROM `products` WHERE `name` LIKE '%$s1%' AND SELECT * FROM `products` WHERE `functions` LIKE '%$s3%'");[/CODE] but that returns the following error: Warning: mysql_num_rows(): supplied argument …

Member Avatar
Member Avatar
+0 forum 4

Hi guys, me again. Having an issue with a multiple select form object that is generated through PHP and retrieves and displays MYSQL values. it displays and retrieves correctly and PHP produces is correctly, however, the form submission to post the values to MYSQL do not, instead it posts the first item selected only instead of all of them. Any help is greatly appreciated as this has been annoying me for days! [CODE] <form action="addproductpost.php?sel=<?php echo $selectedvalue; ?>" enctype="multipart/form-data" method="post"> <div class="style3"> <br /> <table width="568" border="0" align="center" cellpadding="0" cellspacing="0"> <tr class="style1"> <td><div align="center" class="style1 style19 style20">Select Functions</div></td> <td><div align="center" …

Member Avatar
Member Avatar
+0 forum 1

I am needing a dropdown menu to pull data from table on a mysql database and then with the selected item, send it to a new table along with the rest of the data from the form. I have got the dropdown pulling data from the database with the following code: [CODE] <?php $con = mysql_connect($sqlserver,$sqluser,$sqlpassword); if (!$con) { die('Connection to SQL Server failed. Error: ' . mysql_error()); } mysql_select_db($sqldb, $con); $result = mysql_query("SELECT functions FROM functions"); echo "<SELECT id='func' name='func' multiple='multiple'>"; if (mysql_num_rows($result)>0) { while($row=mysql_fetch_array($result)) { echo "<option value='$row[functions]'>$row[functions]</option>"; } } echo "</SELECT>"; mysql_close($con) ?> [/CODE] Which works fine, …

Member Avatar
Member Avatar
+0 forum 2

I seem to be having difficulties when using the following query: [CODE]$query = mysql_query("SELECT * FROM `products` WHERE `name` RLIKE '%$s1%' OR `name` RLIKE '%$s2%' OR `name` RLIKE '%$s3%' OR `name` RLIKE '%$s4%' OR `description` RLIKE '%$s1%' OR `description` RLIKE '%$s2%' OR `description` RLIKE '%$s3%' OR `description` RLIKE '%$s4%' OR `inci` RLIKE '%$s1%' OR `inci` RLIKE '%$s2%' OR `inci` RLIKE '%$s3%' OR `inci` RLIKE '%$s4%' OR `functions` RLIKE '%$s1%' OR `functions` RLIKE '%$s2%' OR `functions` RLIKE '%$s3%' OR `functions` RLIKE '%$s4%' OR `supplier` RLIKE '%$s1%' OR `supplier` RLIKE '%$s2%' OR `supplier` RLIKE '%$s3%' OR `supplier` RLIKE '%$s4%'"); [/CODE] Any clues …

Member Avatar
Member Avatar
+0 forum 1

Hey everyone, new guy here, having an issue with a section of code... decided one day to just stop working, nothing was changed. the code is [code] $query = mysql_query("SELECT * FROM products"); while ($row = mysql_fetch_array($query)){ $productname = $row['name']; $productinci = $row['inci']; $productdescription = $row['description']; $functions = $row['functions']; $pid = $row['id']; $id = "<A href=\"processdeleteproduct.php?id=$pid\">Delete product</A>"; $editid1 = "<A href=\"editindvproduct.php?id=$pid\">Edit product</A>"; [/code] the error is: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\---\allsuppliers.php on line 102 -(Line 102 is the start of the query) Any help would be appreciated. Cheers. Scaasiboi

Member Avatar
Member Avatar
+0 forum 4

The End.