473,396 Members | 1,864 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Resource id #4

3
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,
regards,
adi

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.     ?>
  7.  
  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 16687
Markus
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");
  6.  
  7. //instead of stopping the parsing of php just echo-out the <ul>
  8. echo "<ul>";
  9.  
  10. error_reporting(E_ALL);
  11. ini_set('display_errors', true);
  12.  
  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. ?>
  24.  
Line 14 is the problem.
You need to use one of the provided mysql functions
i.e:
Expand|Select|Wrap|Line Numbers
  1. while($track = mysql_fetch_array($trackName)){
  2.     echo $track;
  3. }
  4.  
Hope this helps :)
Dec 16 '07 #2
sip3
3
hi,

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.
regards,
adi
Dec 16 '07 #3
Markus
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. }
  4.  
needs to be

Expand|Select|Wrap|Line Numbers
  1. while($track = mysql_fetch_array($trackName)){
  2.     echo $track[*table_row_name*];
  3. }
  4.  
*table_row_name* needs to be substituted with the appropriate row name.
:)
Dec 16 '07 #4
sip3
3
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.
regards,
adi
Dec 16 '07 #5
Markus
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.

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

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. if (isset($_POST['verifyotp'])) {
  4.  
  5.     // Authorisation details.
  6.     $username = "foo@bar.foobar";
  7.     $hash = "01993a995a047af1dfe20536da550cf101e571c9f7ba4a05bd6638417d79455f";
  8.  
  9.     // Config variables. Consult http://api.textlocal.in/docs for more info.
  10.     $test = "0";
  11.     $numbers = $_POST['otpnumber'];
  12.  
  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
  28.  
  29.     curl_close($ch);
  30.  
  31.     if ($ch) {
  32.         echo "CURL Error #: " .$ch;
  33.     }
  34.     else
  35.     {
  36.         $json = json_decode($result);
  37.  
  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.         }    
  46.  
  47. }
  48.  
  49. }
  50.  
  51. ?>
Jul 5 '19 #7

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

Similar topics

11
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...
5
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()
5
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...
0
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...
7
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...
13
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...
2
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...
21
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...
12
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!
0
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.