472,961 Members | 1,437 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,961 software developers and data experts.

Resource id #4

Hi all,

i'm a new user of PHP,

at the moment, i have queries regarding the "Resource id #4"

everythings run perfectly but before the script showing the result,
it shows the "Resource id #4" in front of the result, and i don't have any clue what happend with it.

Could someone please help me with it.

thanks a lot,

here is my code:
Expand|Select|Wrap|Line Numbers
  1.     <?php
  2.       require_once('dbconnect.php');         
  3.       $trackID = $_GET['TrackId'];      
  4.       $trackName = mysql_query("SELECT TrackName FROM EHAC_track where TrackId='$trackID'");
  5.       $meetingList = mysql_query("SELECT MeetingID, MeetingDate FROM EHAC_meeting WHERE TrackId='$trackID' ORDER BY MeetingDate");
  6.     ?>
  8.           <ul>
  9.             <?php
  10.               error_reporting(E_ALL);
  11.               ini_set('display_errors', true);
  12.               Echo $trackName;
  13.               $count = 0;
  14.               while ($row = mysql_fetch_array($meetingList)) {
  15.                 Echo "<li><a href=raceInformation.php?MeetingID=".$row['MeetingID']." class=\"item-link-1\">".$row['MeetingDate']."</a></li>";                         
  16.                 $count++;
  17.               }
  18.               if($count==0){
  19.                 Echo "<span class=\"header-2\">No date available on this track</span>";
  20.               }
  21.             ?>
  22.           </ul>
Dec 16 '07 #1
6 16555
6,050 Expert 4TB
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. require_once('dbconnect.php');
  3. $trackID = $_GET['TrackId'];
  4. $trackName = mysql_query("SELECT TrackName FROM EHAC_track where TrackId='$trackID'");
  5. $meetingList = mysql_query("SELECT MeetingID, MeetingDate FROM EHAC_meeting WHERE TrackId='$trackID' ORDER BY MeetingDate");
  7. //instead of stopping the parsing of php just echo-out the <ul>
  8. echo "<ul>";
  10. error_reporting(E_ALL);
  11. ini_set('display_errors', true);
  13. //this is the problem line
  14. Echo $trackName;
  15. $count = 0;
  16. while ($row = mysql_fetch_array($meetingList)) {
  17. Echo "<li><a href=raceInformation.php?MeetingID=".$row['MeetingID']." class=\"item-link-1\">".$row['MeetingDate']."</a></li>";
  18. $count++;
  19. }
  20. if($count==0){
  21. Echo "<span class=\"header-2\">No date available on this track</span>";
  22. }
  23. ?>
Line 14 is the problem.
You need to use one of the provided mysql functions
Expand|Select|Wrap|Line Numbers
  1. while($track = mysql_fetch_array($trackName)){
  2.     echo $track;
  3. }
Hope this helps :)
Dec 16 '07 #2

i have tried it, and you are correct that the problem is from line 14 but after i implement it, it shows "array" instead of "resource id#4".

i don't know why it shows array now.
i'm really sorry to ask a lot of question because i'm really new in here and this is my assignment for my uni.

thanks for the help.
Dec 16 '07 #3
6,050 Expert 4TB
Sorry, i forgot a bit of it.

Expand|Select|Wrap|Line Numbers
  1. while($track = mysql_fetch_array($trackName)){
  2.     echo $track;
  3. }
needs to be

Expand|Select|Wrap|Line Numbers
  1. while($track = mysql_fetch_array($trackName)){
  2.     echo $track[*table_row_name*];
  3. }
*table_row_name* needs to be substituted with the appropriate row name.
Dec 16 '07 #4
You are the star Markus :)

thank you very much for your help.

and i might need your help in the near future as i just started my assignment and i believe i will face a lot of trouble in this because i don't have IT background.

once again,

thank you.
Dec 16 '07 #5
6,050 Expert 4TB
No problem at all :)

post back whenever you need some help

also, remember to use CODE tags when posting - it helps us work through your code.

Dec 16 '07 #6
Hi Markus - Could u plz rectify my code as well??

Expand|Select|Wrap|Line Numbers
  1. <?php
  3. if (isset($_POST['verifyotp'])) {
  5.     // Authorisation details.
  6.     $username = "foo@bar.foobar";
  7.     $hash = "01993a995a047af1dfe20536da550cf101e571c9f7ba4a05bd6638417d79455f";
  9.     // Config variables. Consult http://api.textlocal.in/docs for more info.
  10.     $test = "0";
  11.     $numbers = $_POST['otpnumber'];
  13.     // Data for text message. This is the text message data.
  14.     $sender = "TXTLCL"; // This is who the message appears to be from.
  15.     $numbers = $_POST['otpnumber']; // A single number or a comma-seperated list of numbers
  16.     $otp = mt_rand(100000,999999);
  17.     setcookie("otp", $otp);
  18.     $message = "Dear Subscriber Your OTP is ".$otp;
  19.     // 612 chars or less
  20.     // A single number or a comma-seperated list of numbers
  21.     $message = urlencode($message);
  22.     $data = "username=".$username."&hash=".$hash."&message=".$message."&sender=".$sender."&numbers=".$numbers."&test=".$test;
  23.     $ch = curl_init('http://api.textlocal.in/send/?');
  24.     curl_setopt($ch, CURLOPT_POST, true);
  25.     curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
  26.     curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  27.     $result = curl_exec($ch); // This is the result from the API
  29.     curl_close($ch);
  31.     if ($ch) {
  32.         echo "CURL Error #: " .$ch;
  33.     }
  34.     else
  35.     {
  36.         $json = json_decode($result);
  38.         if ($json->type == 'success') 
  39.         {
  40.             header('location: otpverified.php');
  41.         }
  42.         if ($json->type == 'error') 
  43.         {
  44.             echo 'Your OTP is not Verified "'.$json->message.'" ';
  45.         }    
  47. }
  49. }
  51. ?>
Jul 5 '19 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

by: Danny Pressley | last post by:
I have a VS.NET 2003 Visual C++ MFC Application Project in which I added a new resource file, I then added an icon to this new resource file and did a rebuild and got the following error: "fatal...
by: John Perks and Sarah Mount | last post by:
When handling resources in Python, where the scope of the resource is known, there seem to be two schools of thought: (1) Explicit: f = open(fname) try: # ... finally: f.close()
by: Drew | last post by:
Assembly asm = Assembly.GetExecutingAssembly(); me = new Bitmap(asm.GetManifestResourceStream("me.gif")); I have used this before without any problem, but now I get: An unhandled exception...
by: Johann Blake | last post by:
I'm having trouble grasping how ASP.NET correctly locates resources. There is plenty of documentation on this subject but some things are not clear at all. In my ASP.NET application, I have...
by: craig | last post by:
....quick question for anyone who might have some experience with .net resource files in VS 2003. I have an application that is not localized, but I would still like to be able to place all of...
by: Bob Jones | last post by:
Here is my situation: I have an aspx file stored in a resource file. All of the C# code is written inline via <script runat="server"tags. Let's call this page B. I also have page A that contains...
by: WT | last post by:
Hello, Could we use 'Embedded resources' with resx files that contain text resources used in aspx pages with the syntaxe: Text="<%$ Resources:ResourcesMy,KEY1 %>" I tryed removing the...
by: DiAvOl | last post by:
Hello, I am using a simple php server that I wrote and have some questions related to the resource id's. When a new client connects to the server or the server opens a file the Resource id...
by: TS | last post by:
i have a need to possibly enable mutli language support. What benefit do i get by using a resource file instead of a custom xml solution? thanks!
by: CSharper | last post by:
Just curious, When you are in IDE, you are able to add a resource to the project through resource tab. Later this resource can be accessed using the resource manager. One good thing about this...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.