49 Discussion / Question Topics

Remove Filter
Member Avatar for nonshatter

Hey, I am having a really annoying problem when trying to set up a foreign key in my database... I have two tables - Sell and Category I want the 'c_id' from the Category table to be the foreign key for 'p_id' in the Sell table. Both tables are InnoDB …

Member Avatar for smantscheff
0
4K
Member Avatar for nonshatter

Hey guys, I have this code which grabs categories from my category table of the database and populates the category drop-down box. I was hoping someone could tell me how I could populate the second drop-down box depending on what was selected in the first box. E.g. If "Networking" is …

Member Avatar for prash21m
0
151
Member Avatar for nonshatter

All, I have an issue with my web server, relatively minor but something that has been bugging me: I have two systems, both running the same spec OS, software etc... I use one as a dev server and the other as a production server. The webpage I am rendering on …

Member Avatar for nonshatter
0
120
Member Avatar for nonshatter

I have a foreach loop, within which I would like to create x number of unique variables. E.g. Upon each iteration I'd like to create a new variable like: $strDisk1 = ... $strDisk2 = ... $strDisk3 = ... I have tried the following but this does not work: [CODE] <?php …

Member Avatar for cjohnweb
0
7K
Member Avatar for nonshatter

All, I have two tables. TABLE A TABLE B 1 1 2 2 3 3 4 4 These tables have links in the database. I.e. Table A id 4 can be linked with table B id 2. Or table B id can be linked with an id in table A) …

Member Avatar for twiss
0
85
Member Avatar for nonshatter

Hi there, I am in the process of implementing draggable/droppable interaction using the JQuery UI. This is something that I have very little experience with so please be gentle. I can drag and drop using <tr> elements which looks great, but I need to get the <tr> attributes (perl variables) …

Member Avatar for nonshatter
0
114
Member Avatar for nonshatter

All, I have a simple question. What is the standard procedure for retrieving form values via POST method in a web form? Perl can be extremely awkward for web programming, I'd normally use something else, but in this case I need to use Perl for the CPAN module. Anyway, back …

Member Avatar for nonshatter
0
477
Member Avatar for nonshatter

I have added a png image to a table in the database as a BLOB. Adding the image into the database is trivial. However, being able to display the BLOB back to the .png image format is bewildering me. Examples are hard to come by... How to display the BLOB …

Member Avatar for roswell1329
0
610
Member Avatar for nonshatter

All, I have been trying to debug this problem all weekend but I haven't been able to get any closer to the solution... I have just upgraded Mysql to 5.1 from 4.1 on a Red Hat 4 box. Everything is fine. I can connect to the database using the shell, …

Member Avatar for nonshatter
1
732
Member Avatar for nonshatter

Howdy, I have a basic html file containing certain data I need to extract. This is the code for just one of the tables on the page: [CODE]<TABLE title="Left Magazine"class="dataTable" align="center" cellspacing="0" cellpadding="0"> <caption>Media Details</caption><THEAD><TR class="captionRow"><TH>Slot #</TH><TH>Attn</TH><TH>Status</TH><TH>In Drive</TH><TH>Label</TH><TH>Media Loads</TH><TH>Comment</TH></TR></THEAD> <TBODY> <TR class="altRowColor" > <TD>1 </TD> <TD>&nbsp;</TD><TD>Full, Gen. 3 </TD> <TD>&nbsp;</TD> …

Member Avatar for Ezzaral
0
210
Member Avatar for nonshatter

Hi all, Does anyone know of any software/classes that can be used to generate images of network diagrams? We are using a tool called Graphviz using Perl at the moment but the diagrams are looking a little bit dated! The networks will be pretty small, consisting of 3 or 4 …

Member Avatar for chrishea
0
1K
Member Avatar for nonshatter

Hi all, I'm relatively new to JS and I have an issue which I can't seem to get my head around... I have a perl script which iterates through an array and populates a table with its values. Within the created table I have a link in each row which …

Member Avatar for nonshatter
0
146
Member Avatar for nonshatter

Hi all, I have a simple problem. I have this javascript code which I'm using for collapsible tables: [CODE] <html> <head> <script type="text/javascript"> function getItem(id) { var itm = false; if(document.getElementById) { itm = document.getElementById(id); } else if(document.all) { itm = document.all[id]; } else if(document.layers) { itm = document.layers[id]; } …

Member Avatar for Airshow
0
147
Member Avatar for nonshatter

Hi all, How can I execute an external program (wget) on a linux box? I assume I should be using exec() or something similar. The command I'm trying to execute is: [CODE]wget -p 'x.x.x.x/inventory.ssi?mag_0=1&mag_1=1'[/CODE] Which returns the html page of inventory. I am then parsing the file using DOMDocument to …

Member Avatar for nonshatter
0
134
Member Avatar for nonshatter

Okay, I've been racking my brain trying to figure this one out but the more I try, the more I get stuck. I need to construct a multi-dimensional array as follows, so for each iteration there are 4 values added to the array. (there is a total of 6 iterations, …

Member Avatar for nonshatter
0
105
Member Avatar for nonshatter

Hi all, I'm trying to figure out how to stop MySQL errors being displayed to the user. I have turned off all the necessary options in php.ini such as [CODE]display_errors = Off log_errors = On error_log = /path/to/log/[/CODE] I have even tried to override these settings using ini_set() in my …

Member Avatar for somedude3488
0
247
Member Avatar for nonshatter

Hi all, I have virtually no knowledge of C, but I have a problem with one of my scripts. It runs fine on a 64-bit Linux machine, yet it gives me a seg fault when run on 32-bit linux. gdb tells me that the seg fault occurs on line 314. …

Member Avatar for mitrmkar
0
116
Member Avatar for nonshatter

Hi all, I'm relatively new to Perl and particularly new to regular expressions. This is really simple script I've just mocked up. All it does is to take the input string and check if it's in the correct format or not. Here are some examples of correct format (will always …

Member Avatar for k_manimuthu
0
197
Member Avatar for nonshatter

Hi all, I have a fairly simple problem. I have an array which prints out the following text: [CODE]1 Full, Gen. 3 TMSWK2D 9 Poor write quality 2 Full, Gen. 1 TMSWK2C Read Only, Clean Tape[/CODE] The problem is after some of the lines of text, there are empty values, …

Member Avatar for mschroeder
0
138
Member Avatar for nonshatter

Hi all, I have an array called html which contains rows of text. E.g: [CODE]$html[0] = 1 Full, Gen. 3 TMSWK2D 9 Poor write quality $html[1] = 2 Full, Gen. 1 TMSWK2C Read Only, Clean Tape [/CODE] How would I go about taking each array value and splitting the row …

Member Avatar for nonshatter
0
119
Member Avatar for nonshatter

Hi all, I have a query pulling out dates from a database, these dates are then added to an array and inserted into a graph along the x-axis. From the results, there could be one value with one date or there could be 10 values with one date. This means …

Member Avatar for paulrajj
0
100
Member Avatar for nonshatter

Hi all, I have a fairly simple question on something I know little about... Is there a PHP equivalent to the Perl POD? We're basically switching over from Perl to PHP but we are struggling to find a PHP-ish way of documenting from within our code. If anyone knows anything …

0
62
Member Avatar for nonshatter

Hi all, Just installed PHP 5.2.6 on SLES11. I have editted php.ini to try and turn error reporting on, but it's not turning on (I have restarted apache2). At the moment, I'm using php in cli to debug which is getting a bit stale... Here's a section of my php.ini …

Member Avatar for nonshatter
0
210
Member Avatar for nonshatter

Hey guys, Apologies if this is posted in the wrong place, but couldn't find a suitable forum. Basically I'm making a website for a musician, and was contemplating using WordPress to allow him to be able to manage his own updates, as well as update his image gallery, new videos …

Member Avatar for digital-ether
0
89
Member Avatar for nonshatter

hey guys, I'm trying to simply use the mail function. I'm using ubuntu 8.10 and have installed sendmail. My php.ini config is: [CODE]; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). sendmail_path = /usr/sbin/sendmail -t -i[/CODE] and for testing purposes my php is: [CODE]$to = …

Member Avatar for nileshgr
0
74
Member Avatar for nonshatter

If I have a table sales: sales {sellerid, buyerid} I'm trying to determine the buyers favourite seller... So I need to return the most frequent sellerid. I've used this query to find out the total number of times the buyer has bought something from any seller: [CODE]$countseller = mysql_query("SELECT count(sellerid) …

Member Avatar for nonshatter
0
96
Member Avatar for nonshatter

Hey everyone. I'm having some trouble returning the correct number of matched results after a search query is issued to my site's search bar. I was using this, but it returns the wrong number of matches (only for certain queries): [CODE] $countofrecs = mysql_query("SELECT count(*) from tablename WHERE title OR …

Member Avatar for urtrivedi
0
61
Member Avatar for nonshatter

Hi all, I have a been developing an Online auction website using PHP and Mysql for the last few weeks. I have implemented everything including the 'bidding', 'buy it now' options of the auction etc. I don't know much about AJAX to be honest, but I think it is the …

Member Avatar for fxm
0
4K
Member Avatar for nonshatter

Hi all, I have just made a search bar for a site but I am having trouble trying to return the number of results that are found. E.g. I want it to print "Your search terms returned 'xx' results" after each search. This is my code: [CODE] <?php include ('db.php'); …

Member Avatar for Virtualbase
0
2K
Member Avatar for nonshatter

Hi, I have never used table locking before. Would something like this be sufficient? Basically I want to only allow exclusive write access to the bid table: [CODE] <?php $query = "LOCK TABLES bid WRITE"; $placebid = mysql_query("INSERT INTO bid (auction_id, seller_id, bidder_id, b_timestamp, b_currentprice) VALUES ('$id', '$uid', '$ruid', NOW(), …

0
67
Member Avatar for nonshatter

Hi all, I'm need to devise a server-side method of preventing multiple form submissions. The form is submitted to the same page. I have read about generating a unique value in a session and insert a hidden input field to detect multiple submits, but would this work with a same-page …

Member Avatar for JRM
0
126
Member Avatar for nonshatter

Hi all, Is it possible to use the same javascript code in a while loop? The first record that is pulled from the database displays the javascript counter. Yet on the second iteration of the while loop (a new record pulled from the database), the javascript just seems to get …

Member Avatar for diafol
0
745
Member Avatar for nonshatter

What features does PHP/MySQL provide to deal with concurrent systems? E.g, If I have a table, and I only want to allow one user to update at any one time. I want to put a lock on the database until the update is complete, then once that request is processed, …

Member Avatar for nonshatter
0
591
Member Avatar for nonshatter

Hey guys, Sorry if I am cross-posting, but I can't seem to find a solution to this problem. I have a PHP while loop that retrieves records from my database. Inside the loop, I also have a Javascript counter that I need to generate for each record I retrieve (for …

Member Avatar for almostbob
0
154
Member Avatar for nonshatter

Hey, I have been trying to devise a way to insert a formatted PHP date() variable ($expires) into a publicly available javascript countdown clock. Obviously, this is made difficult because PHP is server-side and Javascript is client-side. This first piece of code is me adding a number of days to …

Member Avatar for BeachyUK
0
238
Member Avatar for nonshatter

Hey guys, I am in need of a live real-time clock to count down to zero depending on the length of days specified in a database (Like an auction count-down timer). For example, I can retrieve the length of time specified in the database, somehow put that value into the …

Member Avatar for nonshatter
0
708
Member Avatar for nonshatter

Hey guys, I am really close with this but can't quite get it right... All I am trying to do is retrieve the users details based on their 'u_id' and display them. [CODE] <?php require ('dbconnect.php'); $user = $_SESSION['username']; //Get the users username $requestuid = mysql_query("SELECT u_id FROM user_usr WHERE …

Member Avatar for nonshatter
0
83
Member Avatar for nonshatter

Hey, I have a combo box and want to populate it with the selected value upon page reload. For a normal text field I would usually do something like this: [CODE] <input type="text" name="title" value="<?php echo $_SESSION['sellform']['title']; ?>"> [/CODE] How could I do the same for a drop-down box? E.g: …

Member Avatar for whiteyoh
0
1K
Member Avatar for nonshatter

Hey guys, I have reached my wits end with this..! This code works on two of the servers that I have tested, but doesn't want to work on the third server that I need it on! It displays fine, but when the form data is posted back itself to be …

Member Avatar for nonshatter
0
160
Member Avatar for nonshatter

Hey guys, I have been moving and testing my scripts on a different web server, but I am not getting the same results on both computers. Here is the code: [CODE] <?php session_start(); //THIS FUNCTION VALIDATES INPUT function VerifyForm(&$values, &$errors) { if (strlen($values['firstname']) == 0) { $errors['firstname'] = 'Please Enter …

Member Avatar for nonshatter
0
67
Member Avatar for nonshatter

Hey guys, I have a drop-down box which lists manufacturers of computer products. I want it so that when a user clicks "Other" from the drop-down box, a new input field appears below it which asks them to specify an alternative manufacturer. [CODE]<select name="cat" id="cat" onchange="setCategories();"> <option value="components">Components</option> <option value="pcs">Desktop …

Member Avatar for nonshatter
0
166
Member Avatar for nonshatter

Hi guys, Basically I'm making an auction website (kinda like eBay), and am trying to make my database 2NF compliant (and eventually 3NF compliant). Here is an outline of my tables/fields: [ATTACH]14300[/ATTACH] I know I need to split the tables up into additional tables so that data isn't repeated, but …

Member Avatar for nonshatter
0
123
Member Avatar for nonshatter

Hey I hope someone can help me here because I am pretty stumped on this one... All I'm trying to do is to update my user_usr table with the submitted form data. It was working perfectly the other day so I must have changed something somewhere. The code and the …

Member Avatar for nonshatter
0
175
Member Avatar for nonshatter

Hey guys, this is probably a really simple question for you experts so I hope you can help..! Basically I have three separate html fields for the user's date of birth: "year" "month" and "date" All I'm trying to do is to take these three from the form and insert …

Member Avatar for nonshatter
0
112
Member Avatar for nonshatter

Hi, I just have a quick/probably dumb question about this vulnerability... "OpenSSH before 5.1 sets the SO_REUSEADDR socket option when the X11UseLocalhost configuration setting is disabled, which allows local users on some platforms to hijack the X11 forwarding port via a bind to a single IP address, as demonstrated on …

Member Avatar for nonshatter
0
161
Member Avatar for nonshatter

Before I begin i'm sorry if this is a noobish question. Basically I'm trying to import a 'forum.sql' file into mysql so that I can access and manipulate it through a Java servlet. The path to the sql dump file is /home/floyd/Desktop/forum/forum.sql so i open a terminal window, cd into …

Member Avatar for mwasif
0
269
Member Avatar for nonshatter

Hey guys, basically what i'm trying to do is take each line from two text files and store them into two variables, salt and original. I then want to pass these 2 variables to a different method called: crypt(String salt, String original) How would I go about doing this? Many …

Member Avatar for ~s.o.s~
0
113
Member Avatar for nonshatter

Hey, can anyone tell me what's wrong with this method? I keep getting <identifier> expected error on line 1. [CODE]public static void FaultHandler (DatagramSocket aSocket, InetAddress aHost, int proxyPort, byte[] requestArray, rec_bytes) { int faultCount = 0; while ( faultCount < 4 ) { DatagramPacket request = new DatagramPacket(requestArray, requestArray.length, …

Member Avatar for nonshatter
0
87
Member Avatar for nonshatter

Can anyone shed some light on these errors? [CODE] public void FaultHandler () { int faultCount = 0; while ( faultCount < 4 ) { DatagramPacket request = new DatagramPacket(requestArray, requestArray.length, aHost, proxyPort); aSocket.send(request); try { aSocket.setSoTimeout(4000); aSocket.receive(reply); } catch ( SocketTimeoutException e ) { faultCount++; continue; } catch ( …

Member Avatar for Cronless
0
212

The End.